3

I've been trying to get boost to compile and install using MinGW (4.8.1) on Windows 7 x64.

It appears to bootstrap ok:

bootstrap.bat mingw

gives:

Building Boost.Build engine

Bootstrapping is done. To build, run:

    .\b2

To adjust configuration, edit 'project-config.jam'.
Further information:

    - Command line help:
    .\b2 --help

    - Getting started guide:
    http://boost.org/more/getting_started/windows.html

    - Boost.Build documentation:
    http://www.boost.org/boost-build2/doc/html/index.html

looks good. Then I try to build and install, using the following command:

b2 variant=release threading=multi toolset=gcc --with-date_time --with-filesystem
--with-iostreams --with-locale --with-program_options --with-regex --with-system
--with-thread --prefix=D:\boost install

but this just results in the unhelpful message:

...found 2 targets...

However, if I leave off the install option the libraries I require get built, but not installed. I've googled and googled and googled, but I just can't find any clues as to where I'm going wrong. In fact, everything out there appears to suggest the install option works just fine!

If I build, and then run the same again with the install option, I get the same "found 2 targets" reponse from b2.

4

2 回答 2

1

如果您看到它的错误,...found 2 targets... 则表示您的 gcc (MinGw) 的路径/设置有问题。只需在您的系统上重新安装 MinGw。我建议使用与您的处理器相同的位系统。然后将系统环境中的路径设置为包含 g++、make... 文件的 bin 文件夹。现在你准备好了。

  1. 出于显而易见的原因,请启动一个新终端 (cmd.exe),不要使用不知道您的新设置的已打开终端。

  2. 下载 boost,最新的稳定版本,解压它,然后在命令窗口中按照解压后的 boost 主目录的路径。

  3. 运行此命令: bootstrap mingw

  4. 之后运行此命令,它将安装在您选择作为目标的文件夹中。

    b2 安装 --prefix=c:\boost\1.54.0\gcc 工具集=gcc

需要一点耐心:)

于 2014-12-01T23:48:09.990 回答
0

当使用 MinGW 4.8.1 时,这发生在我的 Windows 7 64 位上。如果我用 mingw-w64 4.8.1 替换 MinGW 4.8.1,则该过程可以正常工作。

我测试的环境没有其他变化,只有不同的 MinGW 版本。

碰巧我想把所有东西都移到 mingw-w64 以使用 sjlj 异常,所以一切都很好。不知道为什么它在“标准”mingw 下不起作用。

于 2013-09-29T18:15:44.720 回答