Freitag, 23. Oktober 2015

Building findMFBase on windows for VisualStudio

I am trying to build the project https://github.com/findMF/findMFBase 
on windows. (for details of linux build check the .travis.yml file and take a look at Travis build results).

Since, cmake's find_boost does not work on windows, and also setting Boost_DIR in CMake GUI does not work I needed to add to the topmost CMakeLists.txt file

set(BOOST_ROOT "C:/boost/boost_1_57_0/")

Likely you boost installation is somewhere else so adjust it.

I did download prebuild boost libraries from here:
http://sourceforge.net/projects/boost/files/boost-binaries/1.57.0/

And also renamed the lib_win64... directory (the containing the .lib files) into lib/

Than I did run (in PowerShell):

mkdir findMFBaseBuild
cd findMFBaseBuild
cmake ..\findMFBase -G "Visual Studio 12 2013 Win64"

(Since I have VS 2013 community edition installed)

Than I open the generated sln in VS and build the ALL_BUILD project.


What I struggled with when building on windows was the following (now fixed)


Some projects are build but the first project having a dependency on data_time fails with
fatal error LNK1104: cannot open file 'libboost_date_time-vc120-mt-gd-1_59.lib'

I did a search for liboost_*.lib vs. boost_*.lib which returns some discussions on Stackoverflow pointing too:

SET( USE_STATIC_BOOST ON)
set(Boost_USE_STATIC_LIBS ${USE_STATIC_BOOST})


So the solution:
add_definitions( -DBOOST_ALL_NO_LIB )

For more detail see http://www.boost.org/doc/libs/1_57_0/libs/config/doc/html/index.html



Keine Kommentare:

Kommentar veröffentlichen