Seem I can\'t get this to work. I made a simple console application (which depend on websocket++
library) which need Boost
libraries.. but when I t
b2 -j%cores% toolset=%msvcver% address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64
Properties → Linker → General → Additional Library Directories $(BOOST)\stage\x64\lib
The C++ → General → Additional Include Directories parameter is for listing directories where the compiler will search for header files.
You need to tell the linker where to look for libraries to link to. To access this setting, right-click on the project name in the Solution Explorer window, then Properties → Linker → General → Additional Library Directories. Enter <boost_path>\stage\lib
here (this is the path where the libraries are located if you build Boost using default options).
I had the same problem. It was caused because I compiled the Boost with the Visual C++ 2010(v100) and I tried to use the library with the Visual Studio 2012 (v110) by mistake.
So, I changed the configurations (in Visual Studio 2012) going to Project properties -> General -> Plataform Toolset and change the value from Visual Studio 2012 (v110) to Visual Studio 2010 (v100).
This is the simplest way for an amateur like me who is studying C++ on their own:
First Unzip the boost library to any directory of your choice. I recommend c:\directory
.
c:\boost_1_57_0
.Then go over to the link library were you experienced your problems.
c:\boost_1_57_0
.booststrap.bat
(don't bother to type on the command window just wait and don't close the window that is the place I had my problem that took me two weeks to solve. After a while the booststrap
will run and produce the same file, but now with two different names: b2
, and bjam
.b2
and wait it to run.bjam
and wait it to run. Then a folder will be produce called stage
.c:\boost_1_57_0\stage\lib
.And you are good to go!
2>LINK : fatal error LNK1104: cannot open file 'libboost_regex-vc120-mt-sgd-1_55.lib
In my case, bootstrap/bjam was not available (libraries were precompiled and committed to SCM) on old inherited project. Libraries did not have VC or BOOST versioning in their filenames eg: libboost_regex-mt-sgd.lib
, however Processed /DEFAULTLIB:libboost_regex-vc120-mt-sgd-1_55.lib
was somehow triggered automatically.
Fixed by manually adding the non-versioned filename to:
<AdditionalDependencies>$(DK_BOOST)\lib64\libboost_regex-mt-sgd.lib</AdditionalDependencies>
and blacklisting the ...vc120-mt-sgd-1_55.lib
in
<IgnoreSpecificDefaultLibraries>libboost_regex-vc120-mt-sgd-1_55.lib</IgnoreSpecificDefaultLibraries>
I had the same problem and my mistake was that I had installed the binary boost_1_55_0-msvc-11.0-32.exe to use with visual c++ 2010 which has the version v100 (project properties->ConfiguratioProperties->General->platformTooset) not v110 as visual c++ 2012. So I dowloaded boost_1_55_0-msvc-10.0-32.exe and now everything is ok so far.