在Windows上建设加速 [英] Building Boost on Windows
问题描述
我想建立使用MinGW的Windows 7的64位机器上Boost库。当我尝试运行B2
I am trying to build boost libraries on Windows 7 x64 machine using mingw. When I try to run b2
b2 --build-dir="C:\boost\build" --toolset=gcc --with-python
打造我得到一个错误的库
to build the libraries I get an error
Jamroot:138: in modules.load
rule boostcpp.set-version unknown in module Jamfile</C:/Users/root/Downloads/boost_1_47_0>.
C:/Users/root/Downloads/boost_1_47_0/tools/build/v2/build\project.jam:314: in load-jamfile
C:/Users/root/Downloads/boost_1_47_0/tools/build/v2/build\project.jam:62: in load
C:/Users/root/Downloads/boost_1_47_0/tools/build/v2/build\project.jam:168: in project.find
C:/Users/root/Downloads/boost_1_47_0/tools/build/v2\build-system.jam:570: in load
C:\Users\root\Downloads\boost_1_47_0\tools\build\v2/kernel\modules.jam:283: in import
C:\Users\root\Downloads\boost_1_47_0\tools\build\v2\kernel\bootstrap.jam:142: in boost-build
C:\Users\root\Downloads\boost_1_47_0\boost-build.jam:17: in module scope
我是什么做错了,如何解决呢?任何帮助AP preciated
What am I doing wrong and how to fix it? Any help is appreciated
感谢
编辑:
我想使用Boost库使用Qt SDK,它使用MinGW的。这就是为什么我不能用升压安装程序。当然,除非我找不到解决这个问题,我将不得不求助于使用Qt用MSVC建造的。
I want to use boost libraries with qt sdk, which uses mingw. That's why I can't use the boost installer. Of course, unless I fail to find solution to this problem, I will have to resort to using qt built with msvc.
推荐答案
下面是一个教程我写使用MinGW的编译升压1.45.0在Windows 7上。我在这里复制教程情况下,链接中断:
Here is a tutorial I had written to compile Boost 1.45.0 on Windows 7 using MinGW. I copy the tutorial here in case the link breaks:
1)首先,我们需要编译升压。我们将使用Boost的最新版本:1.45.0(可能不是最新版本的时候,你会阅读本教程
1) First we need to compile Boost. We'll use Boost's latest version: 1.45.0 (probably not the latest version at the time you'll read this tutorial.
1.1)下载Boost源代码:
1.1) Download Boost sources:
- http://www.boost.org/users/download/
- 或者直接:的http://sourceforge.net/projects/boost/files/boost/1.45.0/boost_1_45_0.7z/download)
- http://www.boost.org/users/download/
- or directly: http://sourceforge.net/projects/boost/files/boost/1.45.0/boost_1_45_0.7z/download)
1.2)汇编加速,我们需要使用的bjam。的bjam的来源包括在提升的来源。然而,我们不能使用的bjam的二进制文件:我们必须编译它,因为出现以下问题:的 http://comments.gmane.org/gmane.comp.lib.boost.user/64146 。
1.2) To compile Boost, we need to use BJam. BJam's sources are included in boost's sources. Yet, we can't use BJam's binaries: we must compile it because of the following problem: http://comments.gmane.org/gmane.comp.lib.boost.user/64146.
要编译的bjam,去提升的来源,找到的build.bat(应位于\\ boost_1_45_0 \\工具\\建立\\ V2 \\发动机\\ SRC),运行CMD,cd到的build.bat的文件夹,然后执行:海湾合作委员会的build.bat
(<一个href=\"http://www.phy.bnl.gov/~bviren/dayabay/offline/external-trunk/Boost/boost_1_34_1/doc/html/jam/building.html\"相对=nofollow>来源)
To compile BJam, go to Boost's sources, find build.bat (should be located in \boost_1_45_0\tools\build\v2\engine\src), run cmd, cd to build.bat's folder and execute: build.bat gcc
(source)
汇编持续不到30秒。
- 的注1 的:海湾合作委员会必须在$ PATH。如果你没有GCC,你可以在 http://www.mingw.org/wiki/得到它InstallationHOWTOforMinGW 。使用自动安装程序,如果你不想在这上面花的时间。 (不要忘记在安装过程中选择C ++编译器,它只能安装在默认情况下的C编译器)
- 的注2 的:不要叫Cygwin的海湾合作委员会,否则你会得到一个拒绝访问错误,请参阅http://omgili.com/mailinglist/cygwin/cygwin/com/m2t961f6df41004191807y75bc02cfiabd7f684a8d5f8camailgmailcom.html更多细节。更好地利用GCC包含在你的MinGW稍后将你的IDE使用。
- Note 1: gcc must be in the $PATH. If you don't have gcc, you can get it at http://www.mingw.org/wiki/InstallationHOWTOforMinGW. Use the automated installer if you don't want to waste time on it. (don't forget to select the C++ compiler during the installation, it will only install the C compiler by default)
- Note 2: don't call cygwin's gcc otherwise you'll get an "Access denied" error, see http://omgili.com/mailinglist/cygwin/cygwin/com/m2t961f6df41004191807y75bc02cfiabd7f684a8d5f8camailgmailcom.html for more details. Better use gcc included in the MinGW you will later use with your IDE.
1.3)一旦bjam的编译,我们现在可以编译升压。添加bjam.exe $ PATH中,运行CMD,CD \\ boost_1_45_0然后执行:
1.3) Once BJam is compiled, we can now compile Boost. Add bjam.exe in $PATH, run cmd, cd \boost_1_45_0 then execute:
bjam --toolset=gcc "--prefix=C:\DestinationFolder" install
其中, DestinationFolder
是任何你想要的文件夹路径(的来源)。
where DestinationFolder
is whatever folder path you want (source).
编译持续约30分钟。
这篇关于在Windows上建设加速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!