需要帮助从MinGW的源代码构建Boost

ast*_*mmy 5 boost install mingw

我试图从源代码为MinGW构建Boost库.Boost网站说没有保证,但似乎有人成功完成了它.但是我在网上找不到太多指示.

我更新了标题,以便更好地反映我的问题.

========================原帖======================== ======

我下载了Boost 1.53.0,将其解压缩并cd到MinGW shell中的文件夹.它在我尝试的第一步失败了:

$ ./bootstrap.sh mingw
Building Boost.Build engine with toolset gcc...
Failed to build Boost.Build build engine
Consult 'bootstrap.log' for more details
Run Code Online (Sandbox Code Playgroud)

在bootstrap.log中,错误是:

builtins.c:33:23: fatal error: sys/wait.h: No such file or directory
compilation terminated.
execunix.c:17:26: fatal error: sys/resource.h: No such file or directory
compilation terminated.
fileunix.c:98:17: fatal error: ar.h: No such file or directory
compilation terminated.
Run Code Online (Sandbox Code Playgroud)

请帮忙!谢谢!

==================原始结束和更新开始=====================

更新:我在网上找到了这个详细的说明:http: //vijay.axham.com/blog/478/building-boost-binaries-on-mingw

我跟着它,现在陷入了最后的构建步骤,这应该花费很长时间,但我得到了一个错误:

$ b2  --build-dir=$BOOST_BUILD_DIR --prefix=$BOOST_INSTALL_DIR toolset=gcc variant=release link=static threading=multi runtime-link=static install 2>&1 | tee $BOOST_BUILD_DIR/build.log
error: Unable to find file or target named
error:     'boost/tr1/tr1/bcc32'
error: referred from project at
error:     '.'
Run Code Online (Sandbox Code Playgroud)

但目录在那里(应该是因为它刚刚从zip文件中提取)

$ ls boost/tr1/tr1/bcc32/
array.h  random.h  regex.h  tuple.h  type_tra.h  unordere.h
Run Code Online (Sandbox Code Playgroud)

越来越近但仍然需要帮助!谢谢!

ast*_*mmy 4

好的,我成功了。诀窍是下载 tar.bz2 文件,而不是来自 sourceforge 的 zip 文件(特别是http://sourceforge.net/projects/boost/files/boost/1.53.0/)。尽管同一版本的 Boost 的 zip 和 tar.bz2 文件都列在同一文件夹下,但内容是不同的。zip 文件中缺少一些文件夹,并且压缩文件的行结束约定不同。无论如何,在我下载并解压 tar.bz2 文件之后。我按照此处给出的说明进行操作:

http://vijay.tech/articles/wiki/Programming/Cpp/Boost/BuildingBoostOnMinGw

并使用 MinGW shell(确切地说是 mintty)从源代码成功构建了 Boost 库。有一些失败,但可能并不重要:has_icu_test、has_iconv、has_icu_obj、has_icu64_obj、.masm。最后它说

...更新 2 个目标失败... ...跳过 3 个目标... ...更新 10623 个目标...

希望这将来能对其他人有所帮助。