This forum has been archived. Please start a new discussion on GitHub.

linking error...

Hi all,
As I am a new developer for VC++ and .net so please consider my silly mistakes if I did.
I want to use some functions from .dll to my other VC++ client project. It gives no error at the time of compile but while I am going to rebuild it gives me errors this time and these error comes when I call my .dll file’s function:-
// this call gives me linking error
int x = MyCFunc(5); // this function is declare in header file of my .dll
// and error comes :-
Creating library Debug/AP_ProductLocater.lib and object Debug/AP_ProductLocater.exp
ProductLocater.obj : error LNK2001: unresolved external symbol __imp__MyCFunc
C:\Program Files\Quark\QuarkXPress 6.1\XTension\AP_ProductLocater.xnt : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

AP_ProductLocater.xnt - 2 error(s), 0 warning(s)

I think it comes because I didn’t add any reference of my “TestFuncDll.lib“ file in my client project so I must have to include a reference of lib file… so how I add this reference in VC++6.0? if my dll name is “TestFuncDll.dll”?

And also in .net I and getting same error at the time of linking I am giving the name of TestFuncDll.lib after adding in Additional Dependencies Properties(Project Properties>>Linker>> input>> Additional Dependencies). I already have some lines in this edit box and these are:-

now I after adding my lib file reference it becomes:-

So is it right? What should I do for avoiding the linking error?
One more question from where it get the reference of .dll file? If I want to use this .dll from a specific location let say “c:\Onesouce\bin” then what I have to do?

Thanks a lot.
Vineet jain.


  • marc
    marc Florida
    Sorry, but what exactly does this question have to do with Ice?