我试图在C ++ Builder(embarcadero)中的应用程序中使用boost,并且在包含boost / filesystem.hpp和使用Clang进行编译时遇到一些非常奇怪的错误,我只能&# 39;似乎弄清楚造成它的原因。
错误如下所示:
[CLANG Error] logical_op.hpp(145): unknown type name 'or__rebind'
[CLANG Error] if.hpp(72): unknown type name 'if__rebind'
[CLANG Error] eval_if.hpp(43): unknown type name 'eval_if_rebind'
[CLANG Error] identity.hpp(28): unknown type name 'identity_rebind'
[CLANG Error] identity.hpp(37): unknown type name 'make_identity_rebind'
[CLANG Error] not.hpp(44): unknown type name 'not__rebind'
使用函数BOOST_MPL_AUX_LAMBDA_SUPPORT()
时会发生所有这些错误,并且只在使用Clang时才会出现这些错误。该代码可以很好地编译Borlands自己的编译器。
即使它是一个全新的项目,也会发生这种情况,而且我添加的唯一一行是#include <boost/filesystem.hpp>
。
编辑:我刚试过包含<boost/thread.hpp>
,而这里是一个错误引发的错误:
[CLANG Error] greg_month.hpp(62): type 'greg_month_rep' (aka 'constrained_value<greg_month_policies>') is not a direct or virtual base of 'boost::gregorian::greg_month'
[CLANG Error] greg_month.hpp(64): type 'greg_month_rep' (aka 'constrained_value<greg_month_policies>') is not a direct or virtual base of 'boost::gregorian::greg_month'
[CLANG Error] greg_month.hpp(68): use of undeclared identifier 'value_'
[CLANG Error] greg_month.hpp(69): use of undeclared identifier 'value_'
请告诉我是否需要提供更多信息。
我需要设置任何编译器标志,还是我可以错过的其他东西?
提前致谢。
答案 0 :(得分:1)
您必须将$ CG_BOOST_ROOT更改为$ CG_64_BOOST_ROOT才能使用BCC32C(CLANG)来获得BOOST 1.55而不是1.39:
请在此处阅读:http://docwiki.embarcadero.com/RADStudio/Seattle/en/Boost