My VC++ solution includes two projects, an application (exe) and a static library.
Both compile fine, but fail to link. I'm getting an "unresolved external symbol" error for each function from the static lib I use. They look like this:
MyApplication.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __cdecl MyStaticLibrary::accept(int,struct sockaddr *,int *)"
The app find's the .lib just fine, so that is not the issue. I'm thinking the "dllimport" is the problem -- why would it be there when I'm trying to build a static library? Both the app and library use the "Multi-threaded (/MT)" runtime library, not "Multi-threaded DLL (/MD)".
EDIT:
I think some of the answers are right. The library, which is 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 it wasn't meant to be used as a static library?