gpt4 book ai didi

c++ - 构建 cpp-netlib 失败 - 未添加 lib 前缀

转载 作者:太空宇宙 更新时间:2023-11-04 11:32:57 31 4
gpt4 key购买 nike

我正在尝试使用来自 cygwin 的 cmake 构建 cpp-netlib。但是 cmake 尝试查找没有 lib 前缀的包。而 -DBoost_USE_STATIC_LIBS=ON 将无法解决问题!

这是我的命令行:

cmake ../cpp-netlib-0.9.4/ -DBOOST_ROOT:string=/cygdrive/c/Dev/boost_1_55_0 -DBoost_USE_STATIC_LIBS=ON -DBoost_DEBUG=ON -DBoost_DETAILED_FAILURE_MSG=ON

搜索:

-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:930 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-gcc48-mt-1_55;boost_thread-gcc48-mt;boost_thread-mt-1_55;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:966 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-gcc48-mt-d-1_55;boost_thread-gcc48-mt-d;boost_thread-mt-d-1_55;boost_thread-mt-d;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:930 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-gcc48-mt-1_55;boost_filesystem-gcc48-mt;boost_filesystem-mt-1_55;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:966 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-gcc48-mt-d-1_55;boost_filesystem-gcc48-mt-d;boost_filesystem-mt-d-1_55;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:930 ] Searching for PROGRAM_OPTIONS_LIBRARY_RELEASE: boost_program_options-gcc48-mt-1_55;boost_program_options-gcc48-mt;boost_program_options-mt-1_55;boost_program_options-mt;boost_program_options
-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:966 ] Searching for PROGRAM_OPTIONS_LIBRARY_DEBUG: boost_program_options-gcc48-mt-d-1_55;boost_program_options-gcc48-mt-d;boost_program_options-mt-d-1_55;boost_program_options-mt-d;boost_program_options-mt;boost_program_options

这是完整的结果:http://pastebin.com/ZBfQyWvw .

正如您在命令行中看到的,我使用的是 cpp-netlib 0.9.4 和 Boost 1.55.0。

有什么提示吗?

谢谢!

最佳答案

看起来您的 Boost 库是使用指定为编译器的 MSVC 构建的(它们名称中的“-vc120-”就是证据)。使用 Cygwin,您需要为 Unix 变体构建。

摘自 Boost 的 build instructions for Windows 顶部的注释:

A note to Cygwin and MinGW users

If you plan to use your tools from the Windows command prompt, you're in the right place. If you plan to build from the Cygwin bash shell, you're actually running on a POSIX platform and should follow the instructions for getting started on Unix variants. Other command shells, such as MinGW's MSYS, are not supported—they may or may not work.

您可以看到 CMake 的 FindBoost 模块正在做正确的事情;猜测编译器是GCC。例如,链接的 CMake 输出的第 62 行是:

-- [ /usr/share/cmake-2.8.11.2/Modules/FindBoost.cmake:739 ] guessed _boost_COMPILER = -gcc48

关于c++ - 构建 cpp-netlib 失败 - 未添加 lib 前缀,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23925342/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com