2

Like many others i have problems using boost libraries with windows. On Ubuntu 16.04 it works all very well with libboost-all-dev but on windows i have many problems.

I try to build a cryptonote application which i can compile completely without any errors under linux. But i need also windows binaries so i did the steps to install the following tools:

  • Visual Studio 2013 (vc120)
  • CMake 3.10.1
  • Python 3.6.4
  • Boost 1.58

For boost i did the following steps:

  • Installing boost from binary
  • Run bootstrap.bat
  • Run b2 install
  • Run bjam install "--with-some-libs"

Nothing works. The cryptonote throws me an error that some but not all libraries could not be found.

I tried to set the BOOST_ROOT, BOOST_LIBRARY_DIRS, BOOST_INCLUDE_DIRS -> Nothing.

What i did wrong? The error i get from cmake is this:

-- Building for: Visual Studio 12 2013
-- The C compiler identification is MSVC 18.0.31101.0
-- The CXX compiler identification is MSVC 18.0.31101.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for pthread.h
-- Looking for pthread.h - not found
-- Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.10/Modules/FindBoost.cmake:1928 (message):
  Unable to find the requested Boost libraries.

  Boost version: 1.58.0

  Boost include path: C:/local/boost_1_58_0

  Could not find the following static Boost libraries:

          boost_system
          boost_filesystem
          boost_thread
          boost_date_time
          boost_chrono
          boost_regex
          boost_serialization
          boost_program_options

  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:113 (find_package)


-- WARNING: Git was not found!
-- Found PythonInterp: C:/Users/chris/AppData/Local/Programs/Python/Python36-32/python.exe (found version "3.6.4")
CMake Warning in CMakeLists.txt:
  CMAKE_SKIP_INSTALL_RULES was enabled even though installation rules have
  been specified


-- Configuring incomplete, errors occurred!
See also "C:/Users/chris/Documents/GitHub/cryptonote/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/chris/Documents/GitHub/cryptonote/build/CMakeFiles/CMakeError.log".

Maybe someone can help to fix this issue ?

Greetings

Christian Nill
  • 143
  • 1
  • 7
  • Rerun cmake with `-DBoost_DEBUG=ON` and analize its output: which exact files cannot be found and where they have been searched. Then examine your Boost installation for those files. – Tsyvarev Dec 22 '17 at 08:46
  • Ok you're right. After the debug i noticed that the "libs" path is not within the searchpath of release or debug. But then i tried to add -DBOOST_LIBRARY_DIR=PATHTOLIBS with no effect. The search path does not change. I also tried -DBOOST_LIBRARY_DIRS=PATHTOLIBS.. nothing. I searched over many hours through google and so on. I found many commands but nothing really helpful. Thanks for your help. The first step helped me figuring out, where the problem is. But how can i solve this issue now. Sorry for my noob-questions but boost is really new to me. – Christian Nill Dec 22 '17 at 12:40
  • OK i thin i've found the problem. As example the boost_serialization. It searches for the serialization at the correct path but with the filename `libboost_serialization-vc120-mt-s`. The file serialization exists but without the `s` in the filename. – Christian Nill Dec 22 '17 at 12:46

2 Answers2

9

Ok finally i've found a solution after reading many, many and many more pages on the internet.

The solution is really simple. After downloading the boost package and installing it (or building from source) you just need the following two parts:

  • Open your CMD (cmd.exe)
  • switch to your installation directory of boost (example C:\local\boost_1_58_0)

Just run the following commands:

bootstrap.bat
b2 link=static runtime-link=static release stage

This will create all librarys static and makes it useable for cmake.

This solution works for me and made me able to build the needed package.

Thanks for all helpers

Christian Nill
  • 143
  • 1
  • 7
0

Or you could just tell boost which compiler to use by adding

toolset=msvc-12.0

(for MS 2013 v12, etc.)

to the b2 command line :-)