CMake Error: Could NOT find Boost
I'm trying to compile GTSAM on Windows 7. I'm using CMake 3.10 and I've got Visual Studio 2013. I've installed Boost (C:\boost_1_57_0), which I've added as a BOOST_ROOT entry in CMake (following the example in this issue: https://bitbucket.org/gtborg/gtsam/issue/159/cant-compile-examples-in-windows-7-64-bit).
I keep getting the following error during Configuring: Could NOT find Boost CMake Error at CMakeLists.txt:111 (message): Missing required Boost components >= v1.43, please install/upgrade Boost or configure your search paths.
Do I have to explicitly add the paths to all the boost components - BOOST_CHRONO_LIBRARY_DEBUG, RELEASE, etc.? See screenshot of error below.
Comments (4)
-
-
reporter The problem was that I had only installed the header-only Boost libraries. I've subsequently downloaded and installed the pre-built Boost library, and then set BOOST_LIBRARYDIR in CMake to the location of the pre-built lib. I am now able to run Configure and Generate successfully in CMake.
However, on opening the Visual Studio project generated by CMake (gtsam.sln), and compiling it, I get a massive 300-something errors, most of which are linking errors.
I am opening a separate issue for this.
-
@punarjay Is this issue still relevant? If not, please press "resolve".
-
reporter - changed status to resolved
Fixed.
- Log in to comment
Please turn on CMake bool Boost_DEBUG to make the FindBoost script verbose. It will tell you where it's searching, and what library names it's trying to look for.
With some configurations I've had to also set BOOST_LIBRARYDIR and BOOST_INCLUDEDIR
If you only installed static libraries you'll also have to set bool Boost_USE_STATIC_LIBS