My VC ++ solution has two projects: an application (exe) and a static library.
Both compile fine, but are not related. I get an "unresolved external character" error for every function from the static library that I use. They look like this:
MyApplication.obj: error LNK2019: unresolved external character "__declspec (dllimport) int __cdecl MyStaticLibrary :: accept (int, struct sockaddr *, int *)"
The application finds .lib just fine, so this is not a problem. I think the "dllimport" problem is the problem, why will it be there when I try to create a static library? Both the application and the library use the multi-threaded (/ MT) runtime library rather than the multi-threaded DLL (/ MD).
EDIT:
I think some answers are correct. A library called UDT has this in the main header file:
#ifdef UDT_EXPORTS
#define UDT_API __declspec(dllexport)
#else
#define UDT_API __declspec(dllimport)
#endif
Does this mean that it is not intended to be used as a static library?
oskar
source
share