首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Mac OS X上存在clang编译错误的boost 1.53

Mac OS X上存在clang编译错误的boost 1.53
EN

Stack Overflow用户
提问于 2013-04-10 06:51:02
回答 1查看 1.7K关注 0票数 1

我想用clang构建boost,我安装了最新的xcode和命令行工具。编译过的b2现在我尝试:

代码语言:javascript
复制
-mac:boost_1_53_0 tim$ ./b2 toolset=clang cxxflags="-std=c++11 -stdlib=libc++" linkflags="-stdlib=libc++" --prefix="./install-dir" debug release install

并获取next作为输出:

代码语言:javascript
复制
Performing configuration checks

    - 32-bit                   : no
    - 64-bit                   : yes
    - x86                      : yes
    - has_icu builds           : no
warning: Graph library does not contain MPI-based parallel components.
note: to enable them, add "using mpi ;" to your user-config.jam
    - iconv (libc)             : no
    - iconv (separate)         : yes
    - icu                      : no
    - icu (lib64)              : no
    - gcc visibility           : yes
    - long double support      : yes
warning: skipping optional Message Passing Interface (MPI) library.
note: to enable MPI support, add "using mpi ;" to user-config.jam.
note: to suppress this message, pass "--without-mpi" to bjam.
note: otherwise, you can safely ignore this message.
/Users/tim/Desktop/Work/boost_1_53_0/tools/build/v2/build/virtual-target.jam:1079: in virtual-target.register-actual-name from module virtual-target
error: Duplicate name of actual target: <pinstall-dir/lib>libboost_atomic.dylib
error: previous virtual target { clang-darwin%clang-darwin.link.dll-libboost_atomic.dylib.SHARED_LIB { clang-darwin%clang-darwin.compile.c++-lockpool.o.OBJ { lockpool.cpp.CPP } } }
error: created from libs/atomic/build/boost_atomic
error: another virtual target { clang-darwin%clang-darwin.link.dll-libboost_atomic.dylib.SHARED_LIB { clang-darwin%clang-darwin.compile.c++-lockpool.o.OBJ { lockpool.cpp.CPP } } }
error: created from libs/atomic/build/boost_atomic
error: added properties: <debug-symbols>off <define>NDEBUG <inlining>full <optimization>speed <runtime-debugging>off <variant>release
error: removed properties: <debug-symbols>on <inlining>off <optimization>off <runtime-debugging>on <variant>debug
/Users/tim/Desktop/Work/boost_1_53_0/tools/build/v2/build/virtual-target.jam:490: in actualize-no-scanner from module object(file-target)@67176
/Users/tim/Desktop/Work/boost_1_53_0/tools/build/v2/build/virtual-target.jam:135: in object(file-target)@67176.actualize from module object(file-target)@67176
/Users/tim/Desktop/Work/boost_1_53_0/tools/build/v2/build-system.jam:749: in load from module build-system
/Users/tim/Desktop/Work/boost_1_53_0/tools/build/v2/kernel/modules.jam:283: in import from module modules
/Users/tim/Desktop/Work/boost_1_53_0/tools/build/v2/kernel/bootstrap.jam:142: in boost-build from module
/Users/tim/Desktop/Work/boost_1_53_0/boost-build.jam:17: in module scope from module

所以我有一个基本的问题:如何修复这样的错误?

EN

回答 1

Stack Overflow用户

发布于 2013-04-10 12:17:17

如果不构建调试版本,错误就会消失。看起来你不能在同一个目录中安装调试库和发行库。

此命令有效

代码语言:javascript
复制
./b2 toolset=clang cxxflags="-std=c++11 -stdlib=libc++" linkflags="-stdlib=libc++" --prefix="./install-dir" release install

顺便说一句,在mac (和linux)上的应用程序的调试版本中链接release boost库是可以的。您不需要调试版本,除非您想调试boost。

这与Windows上的VisualStudio不同,在Windows上,您需要boost的调试版本才能链接到应用程序的调试版本。

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15913932

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档