[CMake] Lnk 1104 with nmake, and the lib prefix

Philip Lowman philip at yhbt.com
Sun Sep 20 23:35:12 EDT 2009


On Sun, Sep 20, 2009 at 9:33 PM, Alain Leblanc <aalebl at gmail.com> wrote:

> Thanks for the reply. I'm experienced with GCC, but just really
> starting with VC++, and I should probably spend more time learning it.
>
> I am using FindBoost and I know it  finds my boost installation ok
> otherwise cmake would fail. Since I sent my email, I noticed that my
> boost lib directory contained all the boost_XXX.lib files, but not the
> libboost_XXX.lib. Both versions of the files come with boost. So I
> installed them but still no luck.


The libboost_* are static libraries.  You will need them if you want to link
against boost statically.  Also make sure your Boost_USE_STATIC_LIBS is set
accordingly before you call find_package() (see FindBoost documentation).
However if in the add_library() call


> I used the STATIC option instead of SHARED then the library would
> build without problems.
>

Static libraries often build just fine if they depend on other libraries
because linking is deferred until an executable is built.

Shared libraries on MSVC require some preprocessor statements to work
properly to export functions/classes.  The following page might be useful.
http://www.itk.org/Wiki/BuildingWinDLL


-- 
Philip Lowman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090920/29f16823/attachment-0001.htm>


More information about the CMake mailing list