如何使用Visual Studio 2013构建Boost 1.55? [英] How to build Boost 1.55 with Visual Studio 2013?

查看:138
本文介绍了如何使用Visual Studio 2013构建Boost 1.55?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Visual Studio 2013构建Boost 1.55.

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

1)我尝试使用boost-binaries( boost-binaries ),但是使用了Visual Studio当我尝试编译时,写了关于该错误的文章:

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

错误LNK1104:无法打开文件 'libboost_serialization-vc120-mt-gd-1_55.lib'.我用了 boost_1_55_0-msvc-12.0-32.exe或1.55.0-build2(增强二进制文件).

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).

在boost_1_55_0 \ lib32-msvc-12.0目录中找不到该.lib文件.

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

2)我还尝试使用该程序BlueGo 0.1.7( BlueGo ).它工作非常顺利,并创建了我需要的所有库.

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.

问题在于它会创建如下的.lib文件:

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

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

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

但是我使用Visual Studio 2013,要求使用vc120版本的编译器而不是vc110,这会引发错误.

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)最后,我决定自己创建dll/lib文件.

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

我在boost网站上使用了以下指南: 从源代码简化构建.

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

如果您希望使用Visual C ++从源代码进行构建,则可以使用一个简单的方法 本节中描述的构建过程.打开命令提示符,然后 将当前目录更改为Boost根目录.然后,输入 以下命令:

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.

我启动了"VS2012 x86本机工具命令提示符",将目录更改为boost根目录并输入了命令:

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

bootstrap

我立即收到错误消息:

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):致命错误C1083:无法打开包含文件: 'tlhelp32.h':没有这样的文件或目录

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

bootstrap.log文件:

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...

我试图检查该文件是否存在('tlhelp32.h').我创建了一个项目,并包含文件('tlhelp32.h').它已编译,没有任何错误.

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)我也尝试重命名

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

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

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

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

但是Visual Studio再次抛出该错误.

But Visual Studio thrown the error again.

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

您能告诉我问题是什么以及如何使用Visual Studio 2013构建Boost 1.55吗?

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

提前谢谢!

推荐答案

为include变量设置的路径指向Windows 8.0而不是Windows 8.1.

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

您在Visual Studio 2013和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

我从以下位置修改了INCLUDE变量:

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

收件人:

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

这篇关于如何使用Visual Studio 2013构建Boost 1.55?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆