为项目启用clang

Enable clang for project

本文关键字:clang 启用 项目      更新时间:2023-10-16

我决定在项目中测试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++状态页面。

屁股的