Clang编译时的问题汇总
2016-07-07 21:58
211 查看
1,
<span style="color:#ff0000;">test.cpp:(.text+0xc): undefined reference to `std::cout' test.cpp:(.text+0x22): undefined reference to `std::ostream::operator<<(int)' test.cpp:(.text+0x2a): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)' test.cpp:(.text+0x32): undefined reference to `std::ostream::operator<<(std::ostream& (*)(std::ostream&))' test.cpp:(.text+0x4f): undefined reference to `__cxa_allocate_exception' test.cpp:(.text+0x6e): undefined reference to `std::allocator<char>::allocator()' test.cpp:(.text+0x82): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)' test.cpp:(.text+0x94): undefined reference to `std::runtime_error::runtime_error(std::string const&)'</span>这是由于clang编译时默认不是标准的c++库,解决的办法就是在clang编译的选项中加上-lstdc++,用来指明clang编译时使用标准的c++库
相关文章推荐
- Ubuntu编译LLVM
- java.lang.NoClassDefFoundError: org/activiti/bpmn/model/StartEvent
- 中山培训第三题(未解决)
- struts2.5动态方法绑定问题
- Seekbar使用
- 内联函数总结
- FinTech-Blockchain区块链
- C/C++预编译指令总结
- 算法竞赛入门经典学习笔记(1)
- SQL Server游标的使用【转】
- centos安装php扩展soap实现webservice
- 安卓三种解析json数据的优缺点
- C/C++中sizeof()函数的用法
- MySQL存储引擎的区别
- Android中的动态加载
- Qt---网页浏览,文件下载
- Dism 错误 15010
- ACM课程总结报告
- C++析构函数
- linux学习4:Linux 命令缩写