Leonard
Leonard

Reputation: 21

CMake does not find boost libraries (boost_thread, boost_system)

My aim is to use CGAL libraries; I have to configure from Cmake. The problem is that the boost libraries are not found. Of course I know that this question has been asked a couple of times but I was not able to fix the problem by using the provided answers like CMake not finding Boost or Cmake cannot find Boost libraries or Cmake doesn't find Boost

I have set the BOOST_ROOT to C:/dev/boost_1_55_0

This is what I see in CMake:

>CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules       
>/FindBoost.cmake:1111 (message):
>Unable to find the requested Boost libraries.
>
>Boost version: 1.55.0
>
>Boost include path: C:/dev/boost_1_55_0
>
>Could not find the following static Boost libraries:
>
>          boost_thread
>          boost_system
>
>    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:6 (find_package)
>    cmake/modules/CGAL_SetupDependencies.cmake:85 (include)                        
>    CMakeLists.txt:590 (include)

This is what I get when running cmake -DBoost_DEBUG=ON :

>C:\dev\CGAL-4.4>cmake -DBoost_DEBUG=ON
>== Setting paths ==
>-- Build CGAL from release in directory CGAL-4.4
>-- Packagenames: CGAL-4.4
>== Setting paths (DONE) ==
>
>== Generate version files ==
>-- CGAL_MAJOR_VERSION=4
>-- CGAL_MINOR_VERSION=4
>-- CGAL_BUGFIX_VERSION=0
>-- CGAL_SONAME_VERSION=10
>-- CGAL_SOVERSION     =10.0.3
>-- CGAL_REFERENCE_CACHE_DIR=
>-- Building shared libraries
>-- Targetting Visual Studio 10
>-- Target build enviroment supports auto-linking
>-- Using VC10 compiler.
>-- Generator uses intermediate configuration directory: $(Configuration)
>-- USING CMake version: 2.8.12
>-- System: Windows
>== Generate version files (DONE) ==
>
>== Set up flags ==
>-- Build type: Release
>-- USING CXXFLAGS = ' /DWIN32 /D_WINDOWS /W3 /GR /EHsc -D_CRT_SECURE_NO_DEPRECAT
>E -D_SCL_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
> /fp:strict /fp:except- /wd4503 /bigobj /MD /O2 /Ob2 /D NDEBUG'
>-- USING LDFLAGS = ' /machine:X86  /INCREMENTAL:NO'
>== Set up flags (DONE) ==
>
>== Detect external libraries ==
>-- External libraries supported: GMP;MPFR;ZLIB;OpenGL;LEDA;MPFI;RS;RS3;OpenNL;TA
>UCS;Eigen3;BLAS;LAPACK;QGLViewer;ESBTL;Coin3D;NTL;IPE
>-- Preconfiguring library: GMP ...
>-- GMP has been preconfigured:
>--   UseGMP-file:
>--   GMP include:      C:/dev/CGAL-4.4/auxiliary/gmp/include
>--   GMP libraries:    C:/dev/CGAL-4.4/auxiliary/gmp/lib/libgmp-10.lib
>--   GMP definitions:
>-- USING GMP_VERSION = '5.0.1'
>-- Preconfiguring library: MPFR ...
>-- MPFR has been preconfigured:
>--   UseMPFR-file:
>--   MPFR include:      C:/dev/CGAL-4.4/auxiliary/gmp/include
>--   MPFR libraries:    C:/dev/CGAL-4.4/auxiliary/gmp/lib/libmpfr-4.lib
>--   MPFR definitions:
>-- USING MPFR_VERSION = '3.0.0'
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:47
>6 ] _boost_TEST_VERSIONS = 1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.54.0;1
>.54;1.53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;1.50;
>1.49.1;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45
>.1;1.45.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.41.1;1
>.41.0;1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;1.37.
>0;1.37;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1
>.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.
>44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.3
>8;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.
>33
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:47
>8 ] Boost_USE_MULTITHREADED = TRUE
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:48
>0 ] Boost_USE_STATIC_LIBS = OFF
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:48
>2 ] Boost_USE_STATIC_RUNTIME =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:48
>4 ] Boost_ADDITIONAL_VERSIONS = 1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.5
>4.0;1.54;1.53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;
>1.50;1.49.1;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46
>;1.45.1;1.45.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.4
>1.1;1.41.0;1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;
>1.37.0;1.37
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:48
>6 ] Boost_NO_SYSTEM_PATHS =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:53
>8 ] Declared as CMake or Environmental Variables:
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:54
>0 ]   BOOST_ROOT =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:54
>2 ]   BOOST_INCLUDEDIR =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:54
>4 ]   BOOST_LIBRARYDIR =
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:54
>6 ] _boost_TEST_VERSIONS = 1.56.1;1.56.0;1.56;1.55.1;1.55.0;1.55;1.54.1;1.54.0;1
>.54;1.53.1;1.53.0;1.53;1.52.1;1.52.0;1.52;1.51.1;1.51.0;1.51;1.50.1;1.50.0;1.50;
>1.49.1;1.49.0;1.49;1.48.1;1.48.0;1.48;1.47.1;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45
>.1;1.45.0;1.45;1.44.1;1.44.0;1.44;1.43.1;1.43.0;1.43;1.42.1;1.42.0;1.42;1.41.1;1
>.41.0;1.41;1.40.1;1.40.0;1.40;1.39.1;1.39.0;1.39;1.38.1;1.38.0;1.38;1.37.1;1.37.
>0;1.37;1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1
>.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.
>44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.3
>8;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.
>33
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:63
>9 ] location of version.hpp: C:/dev/boost_1_55_0/boost/version.hpp
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:66
>3 ] version.hpp reveals boost 1.55.0
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:73
>9 ] guessed _boost_COMPILER = -vc100
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:74
>9 ] _boost_MULTITHREADED = -mt
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:79
>2 ] _boost_RELEASE_ABI_TAG = -
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:79
>4 ] _boost_DEBUG_ABI_TAG = -gd
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:84
>2 ] _boost_LIBRARY_SEARCH_DIRS = C:/dev/boost_1_55_0/lib;C:/dev/boost_1_55_0/../
>lib;C:/dev/boost_1_55_0/stage/lib;PATHS;C:/boost/lib;C:/boost;/sw/local/lib
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:93
>0 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-vc100-mt-1_55;boost_threa
>d-vc100-mt;boost_thread-mt-1_55;boost_thread-mt;boost_thread
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:96
>6 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-vc100-mt-gd-1_55;boost_thre
>ad-vc100-mt-gd;boost_thread-mt-gd-1_55;boost_thread-mt-gd;boost_thread-mt;boost_
>thread
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:93
>0 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-vc100-mt-1_55;boost_syste
>m-vc100-mt;boost_system-mt-1_55;boost_system-mt;boost_system
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:96
>6 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-vc100-mt-gd-1_55;boost_syst
>em-vc100-mt-gd;boost_system-mt-gd-1_55;boost_system-mt-gd;boost_system-mt;boost_
>system
>-- [ C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoost.cmake:10
>17 ] Boost_FOUND = 1
>CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindBoos
>t.cmake:1111 (message):
>  Unable to find the requested Boost libraries.
>
> Boost version: 1.55.0
>
>  Boost include path: C:/dev/boost_1_55_0
>
>  Could not find the following Boost libraries:
>
>          boost_thread
>          boost_system
>
>  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:6 (find_package)
>  cmake/modules/CGAL_SetupDependencies.cmake:85 (include)
>  CMakeLists.txt:590 (include)
>
>
>-- Boost include:     C:/dev/boost_1_55_0
>-- Boost libraries:
>-- Boost definitions:
>-- USING BOOST_VERSION = '1.55.0'
>== Detect external libraries (DONE) ==
>
>== Write compiler_config.h ==
>== Write compiler_config.h (DONE) ==
>
>== Generating build files ==
>Configuring libCGAL
>-- Requested component: MPFR
>-- Requested component: GMP
>libCGAL is configured
>-- Sources for CGAL component library 'CGAL_Core' detected
>Configuring libCGAL_Core
>-- Requested component: MPFR
>-- Requested component: GMP
>libCGAL_Core is configured
>-- Sources for CGAL component library 'CGAL_ImageIO' detected
>Configuring libCGAL_ImageIO
>-- Could NOT find ZLIB (missing:  ZLIB_LIBRARY ZLIB_INCLUDE_DIR)
>-- OpenGL include:
>-- OpenGL libraries:   glu32;opengl32
>-- Requested component: MPFR
>-- Requested component: GMP
>libCGAL_ImageIO is configured
>-- NOTICE: libCGAL_ImageIO needs ZLib to read compressed files. That feature wil
>l not be activated.
>-- Sources for CGAL component library 'CGAL_Qt3' detected
>Configuring libCGAL_Qt3
>-- libCGAL_Qt3 needs Qt3, cannot be configured.
>-- Sources for CGAL component library 'CGAL_Qt4' detected
>Configuring libCGAL_Qt4
>-- libCGAL_Qt4 needs Qt4, cannot be configured.
>-- Sources for CGAL component libraries 'CGAL_Core;CGAL_ImageIO;CGAL_Qt3;CGAL_Qt
>4' detected
>== Generating build files (DONE) ==
>
>-- Configuring incomplete, errors occurred!

I tried it with ticking the checkbox "CGAL_Boost_USE_STATIC_LIBS" in CMake but it did not help. What can I change so that the program works? Thanks for you answers!

Upvotes: 2

Views: 13077

Answers (2)

Nakamp
Nakamp

Reputation: 120

I built CGAL on VS2013 using this tutorial: https://www.cgal.org/windows_installation.html.

TL;DR (for VS2010): I downloaded and installed prebuit Boost from http://sourceforge.net/projects/boost/files/boost-binaries/1.55.0-build2/ (boost_1_55_0-msvc-10.0-32.exe or 64 version for VS2010). Then I set up system enviroment variables BOOST_LIBRARYDIR=<your path>\libboost_1_55_0\lib32-msvc-10.0 and BOOST_INCLUDEDIR=<your path>\libboost_1_55_0. I ran cmake-gui as usual, opened .sln and built it.

Upvotes: 1

schorsch_76
schorsch_76

Reputation: 862

From experience i know, that you should explicit give the CMake configuration the path to both, includes and libraries, separately. If that doesn't fix your problem, you can set the libraries manually in the extended mode.

Upvotes: 0

Related Questions