繁体   English   中英

“ Thread” Boost无法在OSX上构建?

[英]“Thread” Boost fails to build on OSX?

我正在尝试从OSX 10.10.5上的源代码编译boost 1.57,但似乎无法构建“线程”库。

OSX 10.10.5优胜美地

Xcode 6.1

这是编译命令“

$ ./b2 toolset=clang cxxflags="-arch x86_64 -std=c++11 -stdlib=libstdc++ -ftemplate-depth=512" linkflags="-stdlib=libstdc++" link=static install --with-program_options --with-system --with-filesystem --with-chrono --with-thread

错误:

clang-darwin.compile.c++ bin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi/pthread/thread.o
In file included from libs/thread/src/pthread/thread.cpp:11:
In file included from ./boost/thread/thread_only.hpp:17:
In file included from ./boost/thread/pthread/thread_data.hpp:11:
In file included from ./boost/thread/lock_guard.hpp:12:
./boost/thread/detail/move.hpp:31:10: fatal error: 'type_traits' file not found
#include <type_traits>
         ^
1 error generated.

    "clang++" -x c++ -Wextra -Wno-long-long -Wno-variadic-macros -Wunused-function -arch x86_64 -std=c++11 -stdlib=libstdc++ -ftemplate-depth=512 -O3 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_THREAD_POSIX -DNDEBUG -I"." -c -o "bin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi/pthread/thread.o" "libs/thread/src/pthread/thread.cpp"

...failed clang-darwin.compile.c++ bin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi/pthread/thread.o...
clang-darwin.compile.c++ bin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi/pthread/once.o
In file included from libs/thread/src/pthread/once.cpp:8:
In file included from libs/thread/src/pthread/./once_atomic.cpp:9:
In file included from ./boost/thread/once.hpp:20:
In file included from ./boost/thread/pthread/once_atomic.hpp:16:
./boost/thread/detail/move.hpp:31:10: fatal error: 'type_traits' file not found
#include <type_traits>
         ^
1 error generated.

    "clang++" -x c++ -Wextra -Wno-long-long -Wno-variadic-macros -Wunused-function -arch x86_64 -std=c++11 -stdlib=libstdc++ -ftemplate-depth=512 -O3 -O3 -finline-functions -Wno-inline -Wall -DBOOST_ALL_NO_LIB=1 -DBOOST_SYSTEM_STATIC_LINK=1 -DBOOST_THREAD_BUILD_LIB=1 -DBOOST_THREAD_DONT_USE_CHRONO -DBOOST_THREAD_POSIX -DNDEBUG -I"." -c -o "bin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi/pthread/once.o" "libs/thread/src/pthread/once.cpp"

...failed clang-darwin.compile.c++ bin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi/pthread/once.o...
...skipped <pbin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi>libboost_thread.a(clean) for lack of <pbin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi>pthread/thread.o...
...skipped <pbin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi>libboost_thread.a for lack of <pbin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi>pthread/thread.o...
...skipped <p/usr/local/lib>libboost_thread.a for lack of <pbin.v2/libs/thread/build/clang-darwin-4.2.1/release/link-static/threading-multi>libboost_thread.a...
...failed updating 2 targets...
...skipped 3 targets...

您认为是什么问题?

我是聚会的后来者,但我遇到了同样的问题,问题是您想用C ++ 11而不是libc ++来构建它。

看起来C ++ 11实现的旧版本不完整。 libstdc ++缺少type_traits标头,就这么简单。 使用-stdlib = libc ++开关,应该对您进行排序。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM