gpt4 book ai didi

c++ - 如何使用 Visual Studio 2013 构建 Boost 1.55?

转载 作者:可可西里 更新时间:2023-11-01 17:54:34 26 4
gpt4 key购买 nike

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

1) 我尝试使用 boost-binaries ( boost-binaries ),但是当我尝试编译时,Visual Studio 记录了错误:

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 文件。

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

问题在于它会像这样创建 .lib 文件:

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

但是我用的是Visual Studio 2013,需要用vc120版本的编译器代替vc110,否则会报错。

3) 最后我决定自己创建dll/lib文件。

我在 boost 站点中使用了以下指南: 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

上面我写了,我需要做什么。

我启动“VS2012 x86 Native Tools Command Prompt”,将目录更改为 boost root 目录并输入命令:

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.

在日志文件中,我注意到以下错误:

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

bootstrap.log 文件:

###
### 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')。它编译没有任何错误。

4)我也尝试重命名

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

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

但 Visual Studio 再次抛出错误。

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

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

提前致谢!

最佳答案

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

您在 Visual Studio 2013 和 Windows 8.1 中提到的文件应该在以下路径中找到:

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

我修改了 INCLUDE 变量:

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

关于c++ - 如何使用 Visual Studio 2013 构建 Boost 1.55?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21878267/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com