为项目启用clang
Enable clang for project
我决定在项目中测试clang。有CMake构建系统,所以,我运行这样的命令:
cmake ../ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
MAKE_C_COMPILER= clang
CMAKE_CXX_COMPILER= clang++
-- The C compiler identification is Clang
-- The CXX compiler identification is Clang
-- Check for working C compiler: /usr/bin/clang
-- Check for working C compiler: /usr/bin/clang -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/clang++
-- Check for working CXX compiler: /usr/bin/clang++ -- works
但是建筑已经失败了:
这是make VERBOSE=1
clang++ -DApplicationManager_EXPORTS -g -fPIC -Iinclude -I/usr/include/python2.7 -I/usr/include/ClanLib-2.2 -I/usr/include/Box2D -Wall -g -msse2 -fPIC -o CMakeFiles/ApplicationManager.cpp.o -c ApplicationManager.cpp
错误列表http://pastebin.com/MQmhbW4D.
这也是控制台的截图:http://img689.imageshack.us/img689/5347/clang.png
Clang还没有实现__is_trivial
,所以看起来你现在运气不好。
链接到bug报告
clang项目建议使用GCC 4.5或更早版本的libstdc++。如果您有兴趣在GCC 4.4 libstdc++中使用c++ '0x,请参阅Clang c++状态页面。
屁股的相关文章:
- 编译时未启用intel oneApi CUDA支持
- 奇怪的结构&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?使用指针作为模板参数
- OpenGL在启用深度测试时不会丢弃我的碎片
- 当 noexcept 函数尝试在 gcc 或 clang 中调用非 noexcept 函数时启用警告
- 如何在 CMakeLists.txt for Visual Studio 2019 中启用 clang-tidy?
- 启用优化的 g++ 和 clang++ 的奇怪行为
- 有没有办法在 Mac 上启用本地 CLang++ 的优化?
- 在 Visual Studio 中的 clang 中启用 C++14
- 如何在gcc或clang中启用从int到int64_t的转换警告
- 启用 openmp 时出错 - "ld: library not found for -lgomp" 和 Clang 错误
- 当使用 stdlibc++ 4.7 启用 C++11 时,clang 错误,而 gcc 编译正常
- 在 catch 块中使用 g++ 或 clang++ 启用未引用的局部变量警告
- clang中是否有一组已知的' c++11 '特性默认启用而不需要' -std=c++11 ' ?
- Clang:如何启用ext_vector_type的vector构造函数
- 为项目启用clang