私はWindowsを使用しており、組み込みLinuxデバイスで使用するためにBoostをクロスコンパイルしています(Debianのいくつかのバージョンを実行しているTS-7800です)。Boost を正しくコンパイルできましたが、内部の依存関係の問題が発生しています。特に、Boost ライブラリを TS-7800 に移動すると、Boost ライブラリは独自の依存関係を見つけることができません。
次のように Boost コンパイラを呼び出しています。
b2 toolset=gcc-arm target-os=linux threadapi=pthread --build-dir=ts7800 --with-filesystem stage
(私は他のライブラリも使用していますが、それはそれほど重要ではありません。)
b2
ばかげたディレクトリ構造を生成するため、ライブラリは、たとえばts7800/boost/bin.v2/libs/system/build/gcc-arm/release/target-os-linux/threadapi-pthread/threading-multi/
Boost ルート ディレクトリの下などに配置されます。
ただし、にfilesystem
依存するを使用しようとすると、問題が発生します。 に依存system
する実行可能ファイルを呼び出すとfilesystem
、
./RegistryService: error while loading shared libraries:ts7800\boost\bin.v2\libs\system\build\gcc-arm\release\target-os-linux\threadapi-pthread\threading-multi\libboost_system-gcc-mt-1_53.so.1.53.0: cannot open shared object file: No such file or directory
を呼び出すとreadelf -d libboost_filesystem-gcc-mt-1_53.so
、
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [ts7800\boost\bin.v2\libs\system\build\gcc-arm\release\target-os-linux\threadapi-pthread\threading-multi\libboost_system-gcc-mt-1_53.so.1.53.0]
Boostにそのパス全体をライブラリにリンクさせないようにする方法はありますか? ディレクトリ構造をフラット化するか、後で変更しますか?
または、Linux にそのディレクトリ パスを認識させる方法はありますか? その構造全体を実行可能ファイルと の両方のディレクトリにコピーし、ディレクトリlibboost_filesystem-gcc-mt-1_53.so
の場所を LD_LIBRARY_PATH に追加しようとしましたが、これらの努力はどれもうまくいかなかったようです。(ただし、パスにバックスラッシュがあるため、このルートには少し懐疑的です。)
ご協力ありがとうございました!