Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to build Boost 1.55 with Visual Studio 2013?

I'm trying to build Boost 1.55 with Visual Studio 2013.

1) I tried to use boost-binaries (boost-binaries), but Visual Studio wrote about the error, when I tried to compile:

error LNK1104: cannot open file 'libboost_serialization-vc120-mt-gd-1_55.lib'. I used boost_1_55_0-msvc-12.0-32.exe or 1.55.0-build2 (boost-binaries).

I didn't find that .lib file in the boost_1_55_0\lib32-msvc-12.0 directory.

2) I also tried to use this program BlueGo 0.1.7 (BlueGo). It works very smooth, and create all libraries, which I am needed.

The problem in that it creates .lib files like this:

libboost_serialization-vc110-mt-gd-1_55.lib

But I use Visual Studio 2013 and it is required to use vc120 version of compiler instead vc110, overwise it is thrown an error.

3) In the end I decided to create dll/lib files on my own.

I used following guide in the boost site: Simplified Build From Source.

If you wish to build from source with Visual C++, you can use a simple build procedure described in this section. Open the command prompt and change your current directory to the Boost root directory. Then, type the following commands:

bootstrap
.\b2

Above I wrote, what I needed to do.

I launched "VS2012 x86 Native Tools Command Prompt", changed dir to the boost root dir and entered the command:

bootstrap

Immediately I got the error:

C:\thirdparty\vs2013\x86\boost_1_55_0>.\bootstrap.bat
Building Boost.Build engine

Failed to build Boost.Build engine.
Please consult bootstrap.log for furter diagnostics.

You can try to obtain a prebuilt binary from

   http://sf.net/project/showfiles.php?group_id=7586&package_id=72941

Also, you can file an issue at http://svn.boost.org
Please attach bootstrap.log in that case.

In the log file I noticed following error:

execnt.c(56) : fatal error C1083: Cannot open include file: 'tlhelp32.h': No such file or directory

The bootstrap.log file:

###
### Using 'vc12' toolset.
###

C:\thirdparty\vs2013\x86\boost_1_55_0\tools\build\v2\engine>if exist bootstrap rd /S /Q bootstrap 

C:\thirdparty\vs2013\x86\boost_1_55_0\tools\build\v2\engine>md bootstrap 

C:\thirdparty\vs2013\x86\boost_1_55_0\tools\build\v2\engine>cl /nologo /RTC1 /Zi /MTd /Fobootstrap/ /Fdbootstrap/ -DNT -DYYDEBUG -wd4996 kernel32.lib advapi32.lib user32.lib /Febootstrap\jam0  command.c compile.c constants.c debug.c execcmd.c execnt.c filent.c frames.c function.c glob.c hash.c hdrmacro.c headers.c jam.c jambase.c jamgram.c lists.c make.c make1.c object.c option.c output.c parse.c pathnt.c pathsys.c regexp.c rules.c scan.c search.c subst.c timestamp.c variable.c modules.c strings.c filesys.c builtins.c md5.c class.c cwd.c w32_getreg.c native.c modules/set.c modules/path.c modules/regex.c modules/property-set.c modules/sequence.c modules/order.c 
command.c
compile.c
constants.c
debug.c
execcmd.c
execnt.c
execnt.c(56) : fatal error C1083: Cannot open include file: 'tlhelp32.h': No such file or directory
filent.c
frames.c
function.c
glob.c
hash.c
hdrmacro.c
headers.c
jam.c
jambase.c
jamgram.c
lists.c
make.c
make1.c
object.c
Generating Code...
Compiling...
option.c
output.c
parse.c
pathnt.c
pathsys.c
regexp.c
rules.c
scan.c
search.c
subst.c
timestamp.c
variable.c
modules.c
strings.c
filesys.c
builtins.c
md5.c
class.c
cwd.c
w32_getreg.c
Generating Code...
Compiling...
native.c
set.c
path.c
regex.c
property-set.c
sequence.c
order.c
Generating Code...

I tried to check existed this file or not ('tlhelp32.h'). I created a project and include the file ('tlhelp32.h'). It is compiled without any errors.

4) Also I tried to rename

libboost_serialization-vc110-mt-gd-1_55.lib

to

libboost_serialization-vc120-mt-gd-1_55.lib

But Visual Studio thrown the error again.

Error   1   error LNK1104: cannot open file 'libboost_serialization-vc120-mt-gd-1_55.lib'.

Could you tell me what is the problem and how to build Boost 1.55 with Visual Studio 2013?

Thanks in advance!

like image 317
Maks Avatar asked Feb 19 '14 10:02

Maks


People also ask

How do I add boost to visual studio project?

6.1 Link From Within the Visual Studio IDE Right-click example in the Solution Explorer pane and select Properties from the resulting pop-up menu. In Configuration Properties > Linker > Additional Library Directories, enter the path to the Boost binaries, e.g. C:\Program Files\boost\boost_1_55_0\lib\.

How do I use Visual Studio code in boost library?

Linking the Boost libraries on Visual Studio (Note: In case your project builds a static library, the “Linker” menu will be shown as “Librarian”.) Select the drop-down button and then click <Edit..>. Add the following value: C:\Program Files\boost\boost_1_76_0\bin\$(PlatformTarget)\lib , and hit OK.

How do I add boost to my project?

Create a Boost.In the Add New Item dialog, expand Installed > Visual C++ > Test. Select Boost. Test, then choose Add to add Test. cpp to your project.


1 Answers

The paths set up for the include variable point to Windows 8.0 instead of Windows 8.1.

The file you mention with Visual Studio 2013 and Windows 8.1 should be found in the following path:

C:\Program Files (x86)\Windows Kits\8.1\include\um

I modified the INCLUDE variable from:

INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.0\include\um;C:\Program Files (x86)\Windows Kits\8.0\include\winrt

to:

INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\INCLUDE;C:\Program Files (x86)\Windows Kits\8.1\include\shared;C:\Program Files (x86)\Windows Kits\8.1\include\um;C:\Program Files (x86)\Windows Kits\8.1\include\winrt
like image 108
Kyle Avatar answered Oct 28 '22 00:10

Kyle