ブースト1.61.0(SourceForge - Boost 1.61.0から.7zとしてダウンロード)をインポートしようとしましたが、失敗しました。C++プロジェクトにブースト1.61.0をインポート中にエラーが発生しました
コンソール:
"D:\Program Files (x86)\JetBrains\CLion 2016.2\bin\cmake\bin\cmake.exe" --build C:\Users\Marczak\.CLion2016.2\system\cmake\generated\WsServer-e351c9f9\e351c9f9\Debug --target WsServer -- -j 4
[ 50%] Linking CXX executable WsServer.exe
CMakeFiles\WsServer.dir\build.make:96: recipe for target 'WsServer.exe' failed
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/WsServer.dir/all' failed
CMakeFiles\WsServer.dir/objects.a(main.cpp.obj): In function `_static_initialization_and_destruction_0':
C:/Users/Marczak/boost_1_61_0/boost/system/error_code.hpp:221: undefined reference to `boost::system::generic_category()'
C:/Users/Marczak/boost_1_61_0/boost/system/error_code.hpp:222: undefined reference to `boost::system::generic_category()'
C:/Users/Marczak/boost_1_61_0/boost/system/error_code.hpp:223: undefined reference to `boost::system::system_category()'
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[3]: *** [WsServer.exe] Error 1
mingw32-make.exe[2]: *** [CMakeFiles/WsServer.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles/WsServer.dir/rule] Error 2
CMakeFiles\Makefile2:78: recipe for target 'CMakeFiles/WsServer.dir/rule' failed
mingw32-make.exe: *** [WsServer] Error 2
Makefile:117: recipe for target 'WsServer' failed
CMakeLists.txt:
cmake_minimum_required(VERSION 3.5)
project(WsServer)
set(BOOST_ROOT "C:/Users/Marczak/boost_1_61_0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11")
set(SOURCE_FILES src/main.cpp)
find_package(Boost)
include_directories(${Boost_INCLUDE_DIRS})
add_executable(WsServer ${SOURCE_FILES})
私はfind_package(Boost 1.61.0 COMPONENTS system filesystem REQUIRED)
をすれば私が手:
Error: Unable to find the requested Boost libraries.
Boost version: 1.61.0
Boost include path: C:/Users/Marczak/boost_1_61_0
Could not find the following static Boost libraries:
boost_system boost_filesystem
No Boost libraries were found. You may need to set BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT to the location of Boost.
私は上Boost_USE_STATIC_LIBRARIES
を設定しようとしましたが、それはあまりにも失敗しました。私はCLion 2016.2を使用しています。
更新日:私も古いバージョンを試しました。同じエラー。 .7zの内側に何:私はlib
フォルダを参照して、他のトピックで
。しかしここで私はそれを見ない。 BOOST_LIBRARYDIR
に何を入れるべきですか?
更新日2:https://sourceforge.net/projects/boost/files/boost-binaries/1.61.0/からインストールされたバイナリ。私は新しいフォルダがあることに気づいた:lib64-msvc-14.0
。それは多くの.dllと.libファイルを含んでいます。 boost_atomic-vc140-mt-1_61.dll
。
Boost.orgは言う:
あなたは、Windowsのコマンドプロンプトから、あなたのツールを使用することを計画している場合、あなたは正しい場所にいます。 Cygwinのbashシェルからビルドする場合、実際にはPOSIXプラットフォーム上で動作しており、Unixのバリエーションを開始するための指示に従ってください。 MinGWのMSYS、などの他のコマンドシェルはサポートされていません。が動作する場合と動作しない場合があります。
私はCygwinを使用しようとします。
ここで使用しているコンパイラはどれですか? 'C:/ Users/Marczak/boost_1_61_0'のソースコードを抜粋したような感じです。 – drescherjm
@drescherjmいいえ、私はC++の新機能です。どのようにコンパイルするのですか? –
mingwのバイナリのバイナリをダウンロードする方が良いかもしれません。それで、私はどのコンパイラ/ツールキット 'CLion'がウィンドウの下で使っているのかよく分かりません。それはmingw/gccですか? – drescherjm