2012-02-05 78 views
0

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

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-包括-DIR =的/ usr /包括/ C++/4.2.1 线程模型:POSIX gcc版本4.2.1(基于苹果公司筹建5658)(LLVM建立2336.1.00)

请帮我编译一下。

感谢

+0

从boost网站复制代码时,这是一个愚蠢的错误。我已经纠正了这个问题,现在它运行良好。 – sank 2012-02-05 22:05:44

回答

0

并不意味着是一个解决方案,但我只是想这与升压发布分支(这将是1.49推出),以及它的工作就好了。 并与1.47版本。 (我没有安装1.48)

相同的编译器。

+1

这应该可能是一条评论。 – 2012-02-05 04:37:16

相关问题