views:

795

answers:

1

I have a very simple (currently just a main.cpp) CMake C++ project that I'm trying to build on both Mac OS X and Windows. It depends on libgsasl, which I have compiled as a static library on both platforms.

Mac OS X has no problems building, and Windows doesn't complain during the build either and produces an EXE. When I try to run the EXE on windows, it gives an error message saying the application cannot run because it can't find libgsasl.dll.

I'm not even trying to link against the dynamic library, just the static library (the .lib version). Am I missing something? In Visual Studio it looks like the gsasl.lib file is found and included in the linking command.

A: 

In the MS tool chain, a .lib can either be static library or an import library to the actual DLL.

You can use dumpbin to peek inside the library to see the actual type it is. There are a couple of different ways to handle the details, but my preferred technique is to use the /summary option. An import library will have sections .idata$n (where n is an integer) while a static library will have a .text section.

R Samuel Klatchko