为项目启用 clang
我决定在我的项目中测试 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/铿锵.png
I decided to test clang in my project. There is CMake build system so, I run such command:
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
But building has been failed:
Here is first line of 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
And list of errors http://pastebin.com/MQmhbW4D.
Here is also screenshot of console: http://img689.imageshack.us/img689/5347/clang.png
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Clang 尚未实现 __is_trivial,因此看来您现在运气不佳。
错误报告链接
Clang has not implemented
__is_trivial
, so it seems like you're out of luck for now.Link to bug report
clang 项目建议使用 GCC 4.5 或更早版本的 libstdc++。如果您有兴趣将 C++'0x 与 GCC 4.4 libstdc++ 一起使用,请参阅 Clang C++ 状态页面。
-克里斯
The clang project recommends using libstdc++ from GCC 4.5 or earlier. See the Clang C++ Status page if you're interested in using C++'0x with the GCC 4.4 libstdc++.
-Chris