boost使用笔记
2013-05-30 16:41
141 查看
平台:ubuntu12.04LTS,boost1.53
1、应该用g++编译,而不是cc,本来想亲自解释一下的,然后发现有人写过了,看这里,简单来说,cc是指向gcc的符号链接,而gcc不能处理C++的linking.所以通常编译命令就是g++ myfile.cpp -o myfile,偶尔要链接额外的库,见第2条
还有一段觉得讲得不错(http://stackoverflow.com/questions/1516609/difference-between-cc-gcc-and-g)
2、有时会出现一大堆类似这种错误:undefined reference to boost::system::system_category()...
对于这个,可以编译时链接boost_system库,即-lboost_system;其他的类似处理
1、应该用g++编译,而不是cc,本来想亲自解释一下的,然后发现有人写过了,看这里,简单来说,cc是指向gcc的符号链接,而gcc不能处理C++的linking.所以通常编译命令就是g++ myfile.cpp -o myfile,偶尔要链接额外的库,见第2条
还有一段觉得讲得不错(http://stackoverflow.com/questions/1516609/difference-between-cc-gcc-and-g)
CCis an environment variable referring to the system's C compiler. What it points to (libraries accessible, etc) depend on platform. Often it will point to
/usr/bin/cc, the actual c complier (driver). On linux platforms,
CCalmost always points to
/usr/bin/gcc.
gccis the driver binary for the GNU compiler collection. It can compile C, C++, and possibly other languages; it determines the language by the file extension.
g++is a driver binary like
gcc, but with a few special options set for compiling C++. Notably (in my experience),
g++will link libstdc++ by default, while
gccwon't.
2、有时会出现一大堆类似这种错误:undefined reference to boost::system::system_category()...
对于这个,可以编译时链接boost_system库,即-lboost_system;其他的类似处理
相关文章推荐
- Visual Studio 2010 下 Boost.Thread 库的使用笔记
- 使用boost做post/get请求开发笔记
- Boost使用几条简单笔记
- Boost笔记--Thread--Ubuntu上初次使用时遇到的问题
- Visual Studio 2010 下 Boost.Regex 库的使用笔记
- Boost简单编译和使用的笔记
- Boost::filesystem 使用小笔记
- 笔记:vs使用cmake自动添加opencv和boost(MFC使用cmake建立工程)
- Boost学习笔记(二)------boost::array数组的使用
- Boost使用笔记(Smart_ptr)
- 【Boost】Boost使用几条简单笔记
- Boost::filesystem的使用笔记
- Visual Studio 2010 下 Boost.Regex 库的使用笔记
- 【Boost】Boost使用几条简单笔记
- Boost::filesystem 使用小笔记
- Visual Studio 2010 下 Boost.Regex 库的使用笔记
- Boost笔记-boost使用方式
- Boost::filesystem 使用小笔记
- Boost::filesystem 使用小笔记
- boost::asio::io_service和io_service::work和boost::thread_group配合使用