Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change
Configuration properties > Calling Convention > __stdcall (/Gz)
Configuration properties > Linker > Advanced > Image Has Safe Exception Handlers - No (/SAFESEH:NO)
extern "C" int addnums(int a, int b);
int main()
{
std::cout << addnums(2,3);
system("PAUSE");
}
Error LNK2001 unresolved external symbol _addnums
Error LNK2001 unresolved external symbol _addnums
#include <iostream>
#pragma comment(lib, "R:/Programming Archive/Source/asm/bin/addnums.lib")
extern "C" double addnums(double a, double b);
//double _addnums(double a, double b);
int main()
{
std::cout << addnums(2,3);
system("PAUSE");
}
Severity Code Description Project File Line Suppression State
Error LNK2001 unresolved external symbol _addnums
Error LNK1120 4 unresolved externals
Error LNK2001 unresolved external symbol __imp__system
Error LNK2001 unresolved external symbol ___CxxFrameHandler3
Error LNK2001 unresolved external symbol ___std_terminate
.486
.model flat, stdcall
.code
start:
addnums proc num1:dword, num2:dword
mov eax, num1
mov ecx, num2
add eax, ecx
ret
addnums endp
end start
ml.exe /c /coff addnums.asm
link /NOLOGO /SUBSYSTEM:CONSOLE /out:addnums.lib addnums.obj