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\
How are you setting it up to link? And what does your header file for MyApplication and MyStaticLibrary::accept look like?
If you have both projects in the same solution file, the best way to set it up to link is to right-click the Solution file->Properties and then set the library as a dependency of the application. Visual Studio will handle the linking automatically, and also make sure that the library build is up to date when you build your application.
That error kinda sounds like you have it defined as a DLL import/export in your header file though.
Edit: Yes, that's the problem. You probably created it as a dynamic library first? (or whoever wrote it did.)
There are a few options.
1) You can just delete all of that stuff, and any UDT_API modifiers in the code.
2) You can delete that stuff and add this line:
#define UDT_API
3) A more robust solution is to change it to this:
#ifdef UDT_STATIC
#define UDT_API
#else
#ifdef UDT_EXPORTS
#define UDT_API __declspec(dllexport)
#else
#define UDT_API __declspec(dllimport)
#endif
#endif
And then add the preprocessor directive UDT_STATIC to your projects when you want to use it as a static library, and remove it if you want to use it as a dynamic library. (Will need to be added to both projects.)