iamは、ブーストライブラリを構築し、アプリケーションをビルドするためにcmakeを使用しようとしています。 の構築とインストールブーストはちょうどその結果Getting Started Guideを次と/ usrビルドとリンクBoost
./bootstrap.sh --prefix=/usr
./b2 install
にプレフィックスを変更した私は/ usr/libに今持っている:
libboost_atomic.a
libboost_atomic.so
libboost_atomic.so.1.64.0
...
と/ usr /含める/ブーストで
aligned_storage.hpp
align.hpp
...
マイCMakeLists.txt
cmake_minimum_required (VERSION 2.6)
project (NewMediaServer)
# Set the output folder where your program will be created
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR})
# set the folder of the binarys
include_directories(${PROJECT_BINARY_DIR}/src)
# find all packages which we are depending on
find_package(Boost 1.64 REQUIRED)
# name the main cpp and the executable
add_executable(mediaserver src/MediaServer.cpp)
# configure compile and linking options
target_compile_options(mediaserver PUBLIC -std=c++11 -Wall)
target_link_libraries(mediaserver PUBLIC -pthread -lboost_system -lboost_log -lboost_log_setup -lboost_thread -lboost_date_time -lboost_filesystem)
私はすべてが正常に動作しますが、できるだけ早くIAMとして、次のエラーを取得バイナリIAMを実行している実行....
は本当に任意の助けに感謝!私はまだCmakeとBoostに新しいので、穏やかである) ありがとうございます。
CMakeバージョン2.6および新品Boost 1.64:あなたは本当にか? https://stackoverflow.com/a/42124857/2799037 – usr1234567
@ usr1234567必要なバージョンを適切なものに設定することはできますが、必ずしもOPが2.6を使用しているとは限りません。 –
'CMAKE_BINARY_DIR'は** readonly **変数として扱われます。絶対に設定しないでください。なぜ[find_package(Boost)](https://cmake.org/cmake/help/v3.0/module/FindBoost.html)を使用し、**変数を使用しないでください** Boostとリンクするために定義されていますか? – Tsyvarev