LNK2001: What have I forgotton to set?

Posted by graham.reeds on Stack Overflow See other posts from Stack Overflow or by graham.reeds
Published on 2010-03-29T13:54:37Z Indexed on 2010/03/29 14:03 UTC
Read the original article Hit count: 326

Filed under:
|
|
|

Following on from my previous question regarding debugging of native code, I decided to create a simple test from a console app as I wasn't getting anywhere with debugging the service directly.

So I created a vc6 console app, added the dll project to the workspace and ran it.

Instead of executing as expected it spat out the following linker errors:

 main.obj : error LNK2001: unresolved external symbol "int __stdcall hmDocumentLAdd(char *,char *,long,char *,char *,long,long,long,long *)" (?hmDocumentLAdd@@YGHPAD0J00JJJPAJ@Z)
 main.obj : error LNK2001: unresolved external symbol "int __stdcall hmGetDocBasePath(char *,long)" (?hmGetDocBasePath@@YGHPADJ@Z)
 Debug/HazManTest.exe : fatal error LNK1120: 2 unresolved externals

This seems to be a simple case of forgetting something in the linker options: However everything seems to be normal, and the lib file, dll and source is available. If I change the lib file to load to nonsense it kicks up the fatal error LNK1104: cannot open file "asdf.lib", so that isn't a problem.

I have previously linked to dll and they have just worked, so what I have forgotton to do?

© Stack Overflow or respective owner

Related posts about vc6

Related posts about dll