CLANG与GNU编译器集合-在GNU中编译,但在CLANG中失败
CLANG vs. GNU Compilers Collection - Compiles in GNU but fails in CLANG
我正试图用clang++在MAC OS X 10.9.5 Mavericks中使用第三方lib"ACE 6.2.8"编译我的项目。
我得到以下错误:
In file included from ../../../Client/Chromodoris/Agent/CacheGenerator.cpp:15:
In file included from ../../../Client/Chromodoris/Agent/ACEIncludes.h:22:
In file included from ../../../Client/Chromodoris/ExternalLibs/ACE_wrappers/ace/OS.h:53:
In file included from ../../../Client/Chromodoris/ExternalLibs/ACE_wrappers/ace/Cleanup.h:30:
In file included from ../../../Client/Chromodoris/ExternalLibs/ACE_wrappers/ace/Intrusive_List.h:128:
In file included from ../../../Client/Chromodoris/ExternalLibs/ACE_wrappers/ace/Intrusive_List.inl:5:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:627:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:4013:35: error: no viable overloaded '='
__e->__weak_this_ = *this;
~~~~~~~~~~~~~~~~~ ^ ~~~~~
CLANG++编译器可能有问题吗?有什么变通办法吗?
附加信息:
Moamen-MacBook:ace Moamen$ clang++ --version
Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin13.4.0
Thread model: posix
请注意,我的代码正在调用第三方lib(ACE),它在出现问题的地方调用CLANG++工具链。
请注意,相同的代码是在GNU编译器集合下编译的。我认为这个问题是相关的:根据标准,这些编译器中的哪一个有错误?
我找到了一个解决方法。
我收到了一条注释消息,在上面的错误后2-3行(对不起,没有消息!),告诉我不能从基类转换为派生类。
使用派生类对象而不是基类对象,这个问题应该得到解决。请注意,您可以使用基类而不是派生类,但这取决于您的实现和需求。
相关文章:
- 奇怪的结构&GCC&clang(void*返回类型)
- 数据成员SFINAE的C++17测试:gcc vs clang
- 当我编译webrtc服务器时,Windows上只支持clang-cl
- 为什么在Windows上的VS 2019和Clang 9中"size_t"在没有标题的情况下工作
- 我可以将一个用clang c++11编译的对象与另一个用c++17编译的对象链接起来吗
- Clang bug?使用指针作为模板参数
- clang整洁10忽略了我的NOLINT命令
- 如何防止clang格式在流运算符调用之间添加换行符<<
- 在clang++预处理器中确定gcc工具链版本
- 为什么 Clang 不允许"and"作为函数名称?
- 带有 -stdlib=libc++ 的 clang++ 9.0.1 找不到<optional>
- clang格式:宏的缩进
- CLANG 编译器 说:变量"PTR"可能未初始化
- clang格式:禁用排序包含
- 为什么lambda在clang上崩溃而不是在gcc上崩溃
- gcc和clang在表达式是否为常量求值的问题上存在分歧
- CLANG与GNU编译器集合-在GNU中编译,但在CLANG中失败
- 什么是-D编译器标志C++(clang,GNU,MSVC)
- 在 mac 上的 gnu/clang 编译器中定义相对于可执行文件的框架路径
- 在使用GNU Make和clang的架构x86_64中没有找到ld: symbol(s)