Macos 代码可以在Windows和Linux上编译,但不能在Mac上编译
我正在使用c++0x标志在多个平台上编译一个项目。我唯一遇到问题的平台是Mac。它似乎对其他编译器忽略的事情感到不安。我正在使用Mac10.8、Qt5.3.2和以下版本的clangMacos 代码可以在Windows和Linux上编译,但不能在Mac上编译,macos,qt,gnu-make,Macos,Qt,Gnu Make,我正在使用c++0x标志在多个平台上编译一个项目。我唯一遇到问题的平台是Mac。它似乎对其他编译器忽略的事情感到不安。我正在使用Mac10.8、Qt5.3.2和以下版本的clang clang -v Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) Target: x86_64-apple-darwin12.5.0 Thread model: posix 这就是它正在生成的错误 In file included fro
clang -v
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
这就是它正在生成的错误
In file included from src/qt/bitcoin.cpp:5:
In file included from ../../Qt5.3.2/5.3/clang_64/lib/QtWidgets.framework/Versions/5/Headers/QApplication:1:
In file included from ../../Qt5.3.2/5.3/clang_64/lib/QtWidgets.framework/Versions/5/Headers/qapplication.h:45:
In file included from /Users/user/Qt5.3.2/5.3/clang_64/lib/QtCore.framework/Headers/qcoreapplication.h:45:
In file included from /Users/user/Qt5.3.2/5.3/clang_64/lib/QtCore.framework/Headers/qglobal.h:78:
In file included from /Users/user/Qt5.3.2/5.3/clang_64/lib/QtCore.framework/Headers/qcompilerdetection.h:846:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/utility:254:9: error: field has incomplete type 'CScript'
_T2 second;
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:1994:27: note: in instantiation of template class 'std::__1::pair<const CScriptID, CScript>'
requested here
decltype(__is_constructible_test(declval<_Tp>(), declval<_Args>()...))
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2043:14: note: in instantiation of template class 'std::__1::__is_constructible<false,
std::__1::allocator<std::__1::pair<const CScriptID, CScript> >>' requested here
: public __is_constructible<is_scalar<_Tp>::value || is_reference<_Tp>::value,
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2069:14: note: in instantiation of template class
'std::__1::__is_constructible_void_check<false, std::__1::allocator<std::__1::pair<const CScriptID, CScript> >>' requested here
: public __is_constructible_void_check<__contains_void<_Tp, _Args...>::value
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2549:34: note: in instantiation of template class
'std::__1::is_constructible<std::__1::allocator<std::__1::pair<const CScriptID, CScript> >>' requested here
: __is_nothrow_constructible<is_constructible<_Tp, _Args...>::value, _Tp, _Args...>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/type_traits:2671:14: note: in instantiation of template class
'std::__1::is_nothrow_constructible<std::__1::allocator<std::__1::pair<const CScriptID, CScript> >>' requested here
: public is_nothrow_constructible<_Tp>
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/map:840:13: note: in instantiation of template class
'std::__1::is_nothrow_default_constructible<std::__1::allocator<std::__1::pair<const CScriptID, CScript> > >' requested here
is_nothrow_default_constructible<allocator_type>::value &&
^
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/c++/v1/__config:332:34: note: expanded from macro '_NOEXCEPT_'
# define _NOEXCEPT_(x) noexcept(x)
^
src/keystore.h:43:7: note: in instantiation of exception specification for 'map' requested here
class CBasicKeyStore : public CKeyStore
^
src/serialize.h:28:7: note: forward declaration of 'CScript'
class CScript;
^
src/keystore.h:116:5: note: implicit default constructor for 'CBasicKeyStore' first required here
CCryptoKeyStore() : fUseCrypto(false)
^
我也有同样的问题,它似乎与clang和c++11有关 我的设想: -Mac osx 10.10.1约塞米蒂 -Xcode 6.1和命令行工具6.1 -Gnu make 3.81 -gcc-v: 配置为:-prefix=/Applications/Xcode.app/Contents/Developer/usr-配置为gxx include dir=/usr/include/c++/4.2.1 基于LLVM 3.5svn的Apple LLVM版本6.0-600.0.56 目标:x86_64-apple-darwin14.0.0 线程模型:posix 没有自制,没有macports,只有一些手工编译的依赖项 我正在尝试为x86_64编译 有线索吗
我的想法是用gcc而不是叮当声重新编译每个依赖项,但我仍然没有时间测试它,也许它对你有用 向我们展示生成具有足够上下文的错误的代码。另外:尝试更新您的工具链Clang和libc++,这可能是其中一个已经修复的错误。