[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Mingw-cross-env-list] cmake unable to find boost_thread
From: |
Lothar May |
Subject: |
Re: [Mingw-cross-env-list] cmake unable to find boost_thread |
Date: |
Fri, 27 May 2011 17:36:46 +0200 |
Hi,
2011/5/27 Brad Pitcher <address@hidden>:
> I am trying to compile CGAL with mingw and it seems that cmake can't find
> boost.
> I am running the following command:
> cmake . -DWITH_examples=false -DWITH_demos=false
> -DCMAKE_INSTALL_PREFIX=/home/brad/Downloads/mingw-cross-env/usr/i686-pc-mingw32/
> -DCMAKE_BUILD_TYPE=Release
> -DCMAKE_TOOLCHAIN_FILE=/home/brad/Downloads/mingw-cross-env/usr/i686-pc-mingw32/share/cmake/mingw-cross-env-conf.cmake
> and a lot of it actually works but here is the error with boost:
> CMake Error at cmake/modules/FindBoost.cmake:917 (message):
> Unable to find the requested Boost libraries.
> Boost version: 1.46.1
> Boost include path:
> /home/brad/Downloads/mingw-cross-env/usr/i686-pc-mingw32/include
> The following Boost libraries could not be found:
> boost_thread
> No Boost libraries were found. You may need to set Boost_LIBRARYDIR to
> the
> directory containing Boost libraries or BOOST_ROOT to the location of
> Boost.
> Call Stack (most recent call first):
> cmake/modules/CGAL_SetupBoost.cmake:12 (find_package)
> cmake/modules/CGAL_SetupDependencies.cmake:18 (include)
> CMakeLists.txt:220 (include)
>
> -- Boost include:
> /home/brad/Downloads/mingw-cross-env/usr/i686-pc-mingw32/include
> -- Boost libraries:
> -- Boost definitions:
> -- USING BOOST_VERSION = '1.46.1'
> ======================
> Anyone have any idea how to resolve this? I assume I need to take a look at
> this cmake/modules/FindBoost.cmake and figure out why it's not finding the
> libraries?
Well, the libs are located in ...
/mingw-cross-env/usr/i686-pc-mingw32/lib/libboost*
Specifically, boost_thread is named libboost_thread_win32-mt.a
Maybe cmake looks for a different name with different conventions. You
may try to create a symlink to this file and name it
libboost_thread-mt.a, or libboost_thread.a. Also, cmake may be looking
for a shared lib, as libboost_thread is usually linked as shared.
If you link to the boost_thread static lib in mingw-cross-env, you'll
have to define -DBOOST_THREAD_USE_LIB while building your app.
Otherwise, thread local storage cleanup may cause linker errors or
even runtime problems.
See also https://svn.boost.org/trac/boost/ticket/4921
Regards,
Lothar