Fedora 28でXFSTK構築エラー:/usr/bin/ld:-lboost_program_optionsが見つかりません

Fedora 28でXFSTK構築エラー:/usr/bin/ld:-lboost_program_optionsが見つかりません

xfstkソースコードをダウンロードしてビルドしました。などboostの依存関係をインストールしましたが、インストールlibusb-develしてもインストールされていないというboostエラーメッセージが次のように表示されます。boost

...some output code here

[  0%] Built target docs
[  1%] Built target xfstk-command-line
[  2%] Automatic MOC for target XfstkFactory
[  2%] Built target XfstkFactory_autogen
[ 39%] Built target XfstkFactory
[ 40%] Automatic MOC for target xfstk-dldr-api
[ 40%] Built target xfstk-dldr-api_autogen
[ 40%] Linking CXX shared library libxfstk-dldr-api.so
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/../../../libboost_program_options.so when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/../../../libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible //lib/libboost_program_options.so when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible //lib/libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible //usr/lib/libboost_program_options.so when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible //usr/lib/libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: cannot find -lboost_program_options
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/../../../libboost_program_options.so when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-redhat-linux/8/../../../libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible //lib/libboost_program_options.so when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible //lib/libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible //usr/lib/libboost_program_options.so when searching for -lboost_program_options
/usr/bin/ld: skipping incompatible //usr/lib/libboost_program_options.a when searching for -lboost_program_options
/usr/bin/ld: cannot find -lboost_program_options
collect2: error: ld returned 1 exit status
make[2]: *** [ancillary/configure/api/downloader-api/CMakeFiles/xfstk-dldr-api.dir/build.make:137: ancillary/configure/api/downloader-api/libxfstk-dldr-api.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:366: ancillary/configure/api/downloader-api/CMakeFiles/xfstk-dldr-api.dir/all] Error 2
make: *** [Makefile:152: all] Error 2
[frogwine@leopardpro build]$ 

ベストアンサー1

Linuxディストリビューションでソフトウェアを構築しようとするときに一般的に選択できるパスは2つあります。

オプション

  1. Linuxディストリビューションのパッケージマネージャを活用して、難しい作業を行います。
  2. ビルド/構成ツールが認識できるように、独自のコンパイル済みライブラリをLDのパスにマージします。
オプション1

最初のポイントでは、boostディストリビューションのパッケージマネージャを使用してインストールできます。私は次のようなRedhatディストリビューションに慣れています。

$ sudo yum search boost | grep ^boost | head
yum search boost | grep ^boost | head -10
boost-atomic.i686 : Run-Time component of boost atomic library
boost-atomic.x86_64 : Run-Time component of boost atomic library
boost-chrono.i686 : Run-Time component of boost chrono library
boost-chrono.x86_64 : Run-Time component of boost chrono library
boost-context.i686 : Run-Time component of boost context switching library
boost-context.x86_64 : Run-Time component of boost context switching library
boost-date-time.i686 : Run-Time component of boost date-time library
boost-date-time.x86_64 : Run-Time component of boost date-time library
boost-devel.i686 : The Boost C++ headers and shared development libraries
boost-devel.x86_64 : The Boost C++ headers and shared development libraries

次に、この出力に必要なものをインストールしてください。

$ sudo yum install -y boost boost-devel ....
オプション2

2番目のポイントについては、次のタイトルのU&L Q&Aでこの内容を取り上げました。コンパイル時にブーストライブラリ接続への混乱

おすすめ記事