如何更改/编译检查升压时使用B2的编译器? [英] How to change/check the compiler used by b2 when compiling Boost?
问题描述
由于像类似这样的一个问题:
Due to a problem like similar to this:
Mac OS X和静态加速库 - >标准::字符串失败
即我得到一个运行时错误调用提高文件系统的目录迭代器构造函数时被释放的指针没有被分配的 * 的设置断点malloc_error_break调试。我的IM pression是,如果升压和程序与不同的编译器编译会发生这种情况。
Namely I get a run-time error "pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug" when calling the boost filesystem directory iterator constructor. My impression is this can happen if boost and the program are compiled with different compilers.
所以我想用我使用我的程序相同的编译器,即MacPorts的GCC重新编译升压库(G ++ - MP-4.8)。根据一些网上的说明,我的理解是,我编辑工具/编译/ V2 /用户config.jam中,指定编译器,所以现在说:
So I'm trying to re-compile boost libs using the same compiler I'm using for my programs, namely macports gcc (g++-mp-4.8). Based on some online instructions, my understanding is that I edit tools/build/v2/user-config.jam, to specify the compiler, so it now says:
# Configure gcc (default version).
# using gcc ;
# Configure specific gcc version, giving alternative name to use.
# using gcc : 4.8 : g++-mp-4.8 ;
我的用户config.jam中复制到我的主目录,重新运行bootstrap.sh并重新运行B2。不过,我仍然得到我的错误,来了(被释放的指针没有被分配的 * 的在malloc_error_break设置一个断点调试)。这是用于指定编译器使用编译正当程序?我如何检查,看看哪个编译器升压,当我运行B2实际使用?
I copy user-config.jam to my home directory, rerun bootstrap.sh and rerun b2. However I still get my error that comes up ("pointer being freed was not allocated * set a breakpoint in malloc_error_break to debug"). Is this the right procedure for specifying the compiler to use to compile? How do I check to see which compiler boost is actually using when I run b2?
推荐答案
离开用户config.jam中
在 \\提升\\ TOOLS \\建立\\ V2
。
需要注意的是,从#
开头的行是注释。
您的配置应该是这样的(假设G ++位于全/路径/
并命名为 G ++ - mp4.8
):
Leave user-config.jam
in \boost\tools\build\v2
.
Note that lines beginning from #
are comments.
Your configuration should look like this (assuming that g++ is located at full/Path/
and named g++-mp4.8
):
using gcc : macports :
full/Path/g++-mp4.8 :
<compileflags>--sysroot=full/path/to/sysroot
;
您可能还需要设置&LT;归档&GT;
和&LT; ranlib的&GT;
选项,允许Boost.Build定位 AR
和 ranlib的
。
You might also need to set <archiver>
and <ranlib>
options to allow Boost.Build locating ar
and ranlib
.
在调用像这样的 B2
行此配置:
Invoke this configuration in b2
line like this:
B2工具= GCC-的MacPorts
这篇关于如何更改/编译检查升压时使用B2的编译器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!