views:

272

answers:

3

Hey

I'm getting an unresolved symbol error at linking in my proj. Im linking to an external library, and yes i have set up the configuration correctly, but when in Debug it outputs the following error for every class in the external library:

error LNK2001: unresolved external symbol __CAP_EXIT_Function

The proj uses the same runtime dll as the external library and links against the debug version of the lib.

Any clues as to where to go with this?

BTW, im using VS2008

Thanks

+1  A: 

It seems like you're using the /callcap switch but not defining the callback functions. Please see the previous link and implement the callback functions.

For other library linking errors. Check to make sure you are specifying the .lib file in the additional includes section of the Linker properties?

Also if you have a vcproj file in the same solution as your project, you can right click on your project and setup a dependency for the other library. In that way you don't need to specify an additional library as mentioned above.

Brian R. Bondy
yip, I specify the it in the includes
Jac
Updated answer with what I think your problem is.
Brian R. Bondy
Ya I thought it was that as well, the library proj was set up to use profiling within function calls, I removed that to see if it was the problem but still the same errors
Jac
I think it is still referenced maybe in the lib you are including. I think you still need to define the functions.
Brian R. Bondy
Thanks, after much playing around its working now
Jac
No problem, glad to help.
Brian R. Bondy
Jac, Give this guy the checkmark if he fixed your problem! ;)
Billy ONeal
A: 

Are you including all of the header files that may be needed? You still need to add

#include "MyDll.h"

Even after adding a reference to the dll and adding the directory where it is located to the include directories path. Then you can use the functions in the dll like so.

MyDll::MyFunctions::Function();
ChadNC
Yes, the library headers are included in the precompiled header
Jac
Header issues would throw errors at compile time, not link time.
Billy ONeal
@Billy Good point.
ChadNC
A: 

Is the lib a C lib? In that case you need the extern "C" for the functions in the header, maybe that is missing?

e.g.

extern "C"
{
  void foo(); 
   ...
}

or

   extern "C" void foo();
Anders K.
Nope, its c++ but the main interface to the library is function calls
Jac