[CMake] error of mixed dynamic/static link to Boost in windows VS2008

Forest Yang yzine0511 at gmail.com
Fri Jan 6 00:30:09 EST 2012


Hi,

  I am writing a library using boost_regex. For the unit test part, I
am using boost_unit_test_framework and needs to be dynamical linked.
Everything worked great on Linux but not the Windows VS 2008.

  I used the BoostPro binary installer, got boost components like:
boost_regex-vc90-mt-gd-1_47.dll and .lib,  also the
libboost_regex-vc90-mt-gd-1_47.lib file. After the FIND_PACKAGE(Boost
Components ...) I got the boost_*-vc90-mt-gd-1_47.lib version, (no
prefix lib), however, when I compile the unit test executable, it has
an error fatal error LNK1104: cannot open file
'libboost_regex-vc90-mt-gd-1_47.lib' If I add its directory C:\Program
Files\boost\boost_1_47\lib to the linker's "Additional Library
Directory" in VS2008 everything went OK.

  My question is

1. Where this "libboost*" comes from ? all my CMake script are giving
boost_* instead of libboost_* libraries.
2. When to set this linker directory so I do not need to add this
manually in VS2008.


Thanks.

Forest.


More information about the CMake mailing list