I am currently evaluating this library in my application. According to the release notes, I believe the currently released version should support static linking.
What's new in 6.10.1.0:
* WCL C++ Edition now ca be used as a static linked library;
First of all, the wclAPI header is not really suitable for static linking since it always performs either dllexport or dllimport. I solved this by adding an additional definition check (see below) in the wclAPI header. I can then simply define WCL_STATIC in my application.
#ifdef WCL_STATIC
#define WCL_API
#else
#ifdef WCL_API_EXPORT
#define WCL_API __declspec(dllexport)
#else
#define WCL_API __declspec(dllimport)
...
#endif
#endif
I created a simple test application. I added the WCL source directory as an Additional Include Directory. I added the correct WCL build directory as an Additional Library Directory. I also added wcl.lib to my linker input list. My test application just attempts to load the API:
int _tmain(int argc, _TCHAR* argv[])
{
wcl::CwclAPI api;
api.Load();
api.Unload();
return 0;
}
Compiling and linking works fine, however once my application starts I get the following error:
The program can't start because wcl.dll is missing from your computer.
Try reinstalling the program to fix this problem.
If I place wcl.dll in the same directory as my executable my application works fine. So, there still seems to be some dll importing going on.
What am I doing wrong, or is this a bug in WCL?