Today I wanted to link to functions in an existing LIB file.
I was getting errors like "unresolved external symbol _Function@0"
Looking inside the LIB I could see the functions had plain names - no "@" decorations..This lib was made with C.
MASM's linker expects decorated names - unless you tell it not to.
Took me a while to remember this, hope it helps someone.

FuncName1 proto :dword, :dword
FuncName2 proto

becomes

FuncName1 proto C :dword, :dword
FuncName2 proto C

Now the linker will be able to find the function names, and everything is peachy.


And this is the reason why we can't use the single letter "C" as a variable, or any other sort of Name in MASM ... it's a reserved term.
Posted on 2010-06-28 06:05:42 by Homer