无法使用Mac上的boost编译程序

时间:2012-02-05 00:51:32

标签: c++ boost osx-lion

我最近使用MacPorts在我的MacOSX 10.7上安装了增强1.48。虽然我能够编译boost文档中给出的一些示例,但我在这篇文章中失败了(http://www.boost.org/doc/libs/1_48_0/libs/bimap/example/step_by_step.cpp)。以下是错误消息:

g++  -Wall -I/opt/local/include  -L/opt/local/lib   step_by_step.cpp   -o step_by_step
In file included from /usr/include/machine/_types.h:32,
                 from /usr/include/sys/_types.h:33,
                 from /usr/include/_types.h:27,
                 from /usr/include/unistd.h:71,
                 from /usr/include/c++/4.2.1/bits/os_defines.h:61,
                 from /usr/include/c++/4.2.1/bits/c++config.h:41,
                 from /usr/include/c++/4.2.1/cstddef:50,
                 from /opt/local/include/boost/config/select_stdlib_config.hpp:18,
                 from /opt/local/include/boost/config.hpp:40,
                 from step_by_step.cpp:7:
/usr/include/i386/_types.h:37: error: expected constructor, destructor, or type conversion before ‘typedef’
make: *** [step_by_step] Error 1

以下是有关编译器的详细信息

  

使用内置规格。
  目标:i686-apple-darwin11
  配置为:/private/var/tmp/llvmgcc42/llvmgcc42-2336.1~22/src/configure --disable-checking --enable-werror --prefix = / Developer / usr / llvm-gcc-4.2 --mandir = / share / man --enable-languages = c,objc,c ++,obj-c ++ --program-prefix = llvm- --program-transform-name = / ^ [cg] [^ .-] * $ / s / $ /-4.2/-with-slibdir = / usr / lib --build = i686-apple-darwin11 --enable-llvm = / private / var / tmp / llvmgcc42 / llvmgcc42-2336.1~22 / dst-llvmCore / Developer / usr / local --program-prefix = i686-apple-darwin11- --host = x86_64-apple-darwin11 --target = i686-apple-darwin11 --with-gxx-include-dir = / usr / include / c ++ / 4.2.1   线程模型:posix   gcc版本4.2.1(基于Apple Inc. build 5658)(LLVM build 2336.1.00)

请帮我编译。

由于

1 个答案:

答案 0 :(得分:0)

并不是一个解决方案,但我只是尝试使用Boost发布分支(很快将会是1.49),并且它运行得很好。 随着1.47的发布。 (我没有安装1.48)

相同的编译器。