我正在尝试使用 Visual Studio 2013 构建 Boost 1.55。
1) 我尝试使用 boost-binaries ( boost-binaries ),但是当我尝试编译时,Visual Studio 写了这个错误:
错误 LNK1104:无法打开文件“libboost_serialization-vc120-mt-gd-1_55.lib”。我使用了 boost_1_55_0-msvc-12.0-32.exe 或 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。
如果您希望使用 Visual C++ 从源代码构建,可以使用本节中描述的简单构建过程。打开命令提示符并将当前目录更改为 Boost 根目录。然后,键入以下命令:
bootstrap
.\b2
上面我写了,我需要做什么。
我启动“VS2012 x86 Native Tools 命令提示符”,将 dir 更改为 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):致命错误 C1083:无法打开包含文件:'tlhelp32.h':没有这样的文件或目录
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 吗?
提前致谢!