wscriptにC++ライブラリcpp-netlibを追加したいと思います。 は、その後、私はdpkg -l libcppnetlib0
を実行する場合、私は得る:Waf - ライブラリをwscriptファイルに追加するにはどうすればいいですか?
libcppnetlib0: 0.11.0-1 amd64 C++ Network Library
実行:dpkg -L libcppnetlib0
を、私は得る:
/.
/usr
/usr/lib
/usr/lib/x86_64-linux-gnu
/usr/lib/x86_64-linux-gnu/cppnetlib-uri.so.0.11.0
/usr/lib/x86_64-linux-gnu/cppnetlib-server-parsers.so.0.11.0
/usr/lib/x86_64-linux-gnu/cppnetlib-client-connections.so.0.11.0
/usr/share
/usr/share/lintian
/usr/share/lintian/overrides
/usr/share/lintian/overrides/libcppnetlib0
/usr/share/doc
/usr/share/doc/libcppnetlib0
/usr/share/doc/libcppnetlib0/copyright
/usr/share/doc/libcppnetlib0/changelog.Debian.gz
/usr/lib/x86_64-linux-gnu/libcppnetlib-server-parsers.so.0
/usr/lib/x86_64-linux-gnu/libcppnetlib-client-connections.so.0
/usr/lib/x86_64-linux-gnu/libcppnetlib-uri.so.0
私はlibcppnetlib-uri, libcppnetlib-server-parsers, libcppnetlib-client-connections
を必要とするので、私は次のフィールドを追加します。wscriptに:
conf.check_cxx(lib='cppnetlib-uri',uselib_store='CPPNETLIBU', define_name='HAVE_CPPNETLIBU',mandatory=True)
conf.check_cxx(lib='cppnetlib-server-parsers',uselib_store='CPPNETLIBS', define_name='HAVE_CPPNETLIBS',mandatory=True)
conf.check_cxx(lib='cppnetlib-client-connections',uselib_store='CPPNETLIBC', define_name='HAVE_CPPNETLIBC',mandatory=True)
次に、3つのリファレンス(CPPNETLIBU、CPPNETLIBC、CPPNETLIBS)を
に追加しました。libndn_cxx = dict(
target="ndn-cxx",
name="ndn-cxx",
source=bld.path.ant_glob('src/**/*.cpp',
excl=['src/security/**/*-osx.cpp',
'src/**/*-sqlite3.cpp']),
headers='src/common-pch.hpp',
use='version BOOST CRYPTOPP OPENSSL SQLITE3 RT PTHREAD CPPNETLIBC CPPNETLIBU CPPNETLIBS',
includes=". src",
export_includes="src",
install_path='${LIBDIR}')
しかし、./waf configureを起動すると失敗し、指定したライブラリが見つかりません。
エラーは次のとおりです。
[199/200] Linking build/examples/clientMat
examples/clientMat.cpp.2.o: In function `construct<boost::network::http::impl::normal_delegate, asio::io_service&>':
/usr/include/c++/4.9/ext/new_allocator.h:120: undefined reference to `boost::network::http::impl::normal_delegate::normal_delegate(asio::io_service&)'
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libcppnetlib-client-connections.so: undefined reference to `boost::system::system_category()'
/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu/libcppnetlib-client-connections.so: undefined reference to `boost::system::generic_category()'
collect2: error: ld returned 1 exit status
I(多分?)/ usr/local/libディレクトリ/ pkgconfigにおける任意の参照が存在しない場合に問題を特定しました。確かに、実行:ls /usr/local/lib/pkgconfig
、私はいくつかの.pc
ファイルがcppnetlibについては何も持っています。私は成功せずに自分自身を書くことを試みた。
ここに問題がある場合は、実際に.pc
ファイルを正しく書き込む方法についてのヘルプが必要です。
この質問は良い出発点でしたが、私は成功同じことをしませんでした:waf -how to add external library to wscript_build file
wscriptファイルにライブラリ依存関係を追加するプロセスは、上記のとおり正確です。ドキュメンテーションが不足しているため、この質問は役に立ちます。疑問の問題は別の余分な図書館がないことでした。 –