我正试图在我的项目中包括Boost
个图书馆,并且一直面临着同样的问题.我在使用Codeblocks IDE的Ubuntu12.10上,试着手动安装库,阅读网站上的说明,但在使用库之前得到了错误的标题和构建.
然后我通过terminalby sudo apt-get install libboost-all-dev
安装了这些库.在此之后,在我的代码块程序中,我可以包括#include <boost/regex.hpp>
这样的头,但当我试图包括文件系统库(#include "boost/filesystem/operations.hpp"
)的头时,我得到了以下错误:
/usr/include/boost/system/error_code.hpp|214|undefined reference to boost::system::generic_category()'|
我不知道如何解决这个错误(特别是在Linux上的代码块中).我真的需要一些帮助.
Compiler : Gcc
Program code: Only tried inlcuding the above file system operations.hpp
file.
从代码块生成日志(log):
Build started on: 20-11-2012 at 18:02.53
Build ended on: 20-11-2012 at 18:02.54
-------------- Build: Debug in libopenFrameworks ---------------
Target is up to date.
-------------- Build: Debug in reader1 ---------------
make -s -f Makefile Debug
linking i686 bin/reader1_debug linux
obj/i686Debug/src/testApp.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
obj/i686Debug/src/main.o: In function `__static_initialization_and_destruction_0':
/usr/include/boost/system/error_code.hpp:214: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:215: undefined reference to `boost::system::generic_category()'
/usr/include/boost/system/error_code.hpp:216: undefined reference to `boost::system::system_category()'
collect2: ld returned 1 exit status
make: *** [bin/reader1_debug] Error 1
Process terminated with status 2 (0 minutes, 1 seconds)
6 errors, 0 warnings