プロジェクトにライブラリを含めようとしBoost
ていますが、同じ問題に直面しています。私はCodeblocks IDEを使用してUbuntu 12.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 のコードブロックで)。私は本当にここでいくつかの助けを借りることができました.
コンパイラ: Gcc
プログラム コード: 上記のファイル システムoperations.hpp
ファイルのみを含めようとしました。
Codeblocks からのビルド ログ:
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