[CMake] Linking boost failure

Hendrik Sattler post at hendrik-sattler.de
Tue Dec 9 13:49:43 EST 2008


Am Tuesday 09 December 2008 18:09:23 schrieb kafou nmento:
> Hi all!
> I'm compiling a Qt based libtorrent app with CMake using MinGW generator.
> For those not knowing libtorrent, it is a lib fully boost based. (boost
> version used 1.34.1). 100% of the build goes well. But at the linking it
> fails with errors like "undefined reference to boost::....". The most
> recurrent is boost::mutex related. I'm on Windows XP.
> The same app works fine with MSVC 2008. I used for both Visual and CMake
> the same libs and preprocessor definition. 
> If some one can help me (^_^)

Using mingw, you _must_ give the target_link_libraries() manually. Using msvc, 
autolinking is used but can be turned off. Have both active also works just 
fine.

This is also described on the boost website.

HS



More information about the CMake mailing list