找不到CMake的boost_regex库



我正在尝试安装一些东西(在Raspberry 2上修改的仿真),在某个时候需要使用CMake命令,该命令需要Boost库才能正确执行。

以下是我的命令行调试:

root@retropie:/home/pi/recalbox-emulationstation# sudo make
Looking for bcm_host.h
bcm_host.h found
Looking for libMali.so
libMali.so not found
-- Looking for FreeImage...
-- checking for module 'freeimage'
--   package 'freeimage' not found
-- Found FreeImage: optimized;/usr/lib/libfreeimage.so;debug;/usr/lib/libfreeimage.so
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:566 ] _boost_TEST_VERSIONS = 1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:568 ] Boost_USE_MULTITHREADED = TRUE
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:570 ] Boost_USE_STATIC_LIBS =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:572 ] Boost_USE_STATIC_RUNTIME =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:574 ] Boost_ADDITIONAL_VERSIONS =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:576 ] Boost_NO_SYSTEM_PATHS =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:644 ] Declared as CMake or Environmental Variables:
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:646 ]   BOOST_ROOT = /usr/include/boost
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:648 ]   BOOST_INCLUDEDIR =
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:650 ]   BOOST_LIBRARYDIR = /usr/include/boost/regex/v4
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:652 ] _boost_TEST_VERSIONS = 1.56.0;1.56;1.55.0;1.55;1.54.0;1.54;1.53.0;1.53;1.52.0;1.52;1.51.0;1.51;1.50.0;1.50;1.49.0;1.49;1.48.0;1.48;1.47.0;1.47;1.46.1;1.46.0;1.46;1.45.0;1.45;1.44.0;1.44;1.43.0;1.43;1.42.0;1.42;1.41.0;1.41;1.40.0;1.40;1.39.0;1.39;1.38.0;1.38;1.37.0;1.37;1.36.1;1.36.0;1.36;1.35.1;1.35.0;1.35;1.34.1;1.34.0;1.34;1.33.1;1.33.0;1.33
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:734 ] location of version.hpp: /usr/include/boost/version.hpp
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:753 ] version.hpp reveals boost 1.49.0
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:785 ] guessed _boost_COMPILER = -gcc47
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:795 ] _boost_MULTITHREADED = -mt
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:838 ] _boost_RELEASE_ABI_TAG = -
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:840 ] _boost_DEBUG_ABI_TAG = -d
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:883 ] _boost_LIBRARY_SEARCH_DIRS = /usr/include/boost/regex/v4;/usr/include/boost/lib;/usr/include/boost/stage/lib;/usr/include/lib;/usr/include/../lib;/usr/include/stage/lib;C:/boost/lib;C:/boost;/boost/boost_1_49_0/lib;/boost/boost_1_49/lib;/boost/lib;/boost;/sw/local/lib
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:961 ] Searching for SYSTEM_LIBRARY_RELEASE: boost_system-gcc47-mt-1_49;boost_system-gcc47-mt;boost_system-mt-1_49;boost_system-mt;boost_system
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:993 ] Searching for SYSTEM_LIBRARY_DEBUG: boost_system-gcc47-mt-d-1_49;boost_system-gcc47-mt-d;boost_system-mt-d-1_49;boost_system-mt-d;boost_system-mt;boost_system
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:961 ] Searching for FILESYSTEM_LIBRARY_RELEASE: boost_filesystem-gcc47-mt-1_49;boost_filesystem-gcc47-mt;boost_filesystem-mt-1_49;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:993 ] Searching for FILESYSTEM_LIBRARY_DEBUG: boost_filesystem-gcc47-mt-d-1_49;boost_filesystem-gcc47-mt-d;boost_filesystem-mt-d-1_49;boost_filesystem-mt-d;boost_filesystem-mt;boost_filesystem
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:961 ] Searching for DATE_TIME_LIBRARY_RELEASE: boost_date_time-gcc47-mt-1_49;boost_date_time-gcc47-mt;boost_date_time-mt-1_49;boost_date_time-mt;boost_date_time
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:993 ] Searching for DATE_TIME_LIBRARY_DEBUG: boost_date_time-gcc47-mt-d-1_49;boost_date_time-gcc47-mt-d;boost_date_time-mt-d-1_49;boost_date_time-mt-d;boost_date_time-mt;boost_date_time
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:961 ] Searching for REGEX_LIBRARY_RELEASE: boost_regex-gcc47-mt-1_49;boost_regex-gcc47-mt;boost_regex-mt-1_49;boost_regex-mt;boost_regex
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:993 ] Searching for REGEX_LIBRARY_DEBUG: boost_regex-gcc47-mt-d-1_49;boost_regex-gcc47-mt-d;boost_regex-mt-d-1_49;boost_regex-mt-d;boost_regex-mt;boost_regex
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:961 ] Searching for LOCALE_LIBRARY_RELEASE: boost_locale-gcc47-mt-1_49;boost_locale-gcc47-mt;boost_locale-mt-1_49;boost_locale-mt;boost_locale
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:993 ] Searching for LOCALE_LIBRARY_DEBUG: boost_locale-gcc47-mt-d-1_49;boost_locale-gcc47-mt-d;boost_locale-mt-d-1_49;boost_locale-mt-d;boost_locale-mt;boost_locale
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:961 ] Searching for THREAD_LIBRARY_RELEASE: boost_thread-gcc47-mt-1_49;boost_thread-gcc47-mt;boost_thread-mt-1_49;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:993 ] Searching for THREAD_LIBRARY_DEBUG: boost_thread-gcc47-mt-d-1_49;boost_thread-gcc47-mt-d;boost_thread-mt-d-1_49;boost_thread-mt-d;boost_thread-mt;boost_thread
-- [ /usr/share/cmake-2.8/Modules/FindBoost.cmake:1107 ] Boost_FOUND = FALSE
CMake Error at /usr/share/cmake-2.8/Modules/FindBoost.cmake:1194 (message):
  Unable to find the requested Boost libraries.
  Boost version: 1.49.0
  Boost include path: /usr/include
  The following Boost libraries could not be found:
          boost_regex
  Some (but not all) of the required Boost libraries were found.  You may
  need to install these additional Boost libraries.  Alternatively, set
  BOOST_LIBRARYDIR to the directory containing Boost libraries or BOOST_ROOT
  to the location of Boost.
Call Stack (most recent call first):
  CMakeLists.txt:56 (find_package)

-- Configuring incomplete, errors occurred!
Makefile:237: recipe for target 'cmake_check_build_system' failed
make: *** [cmake_check_build_system] Error 1

我不明白为什么它不起作用,我试着在我的CMakeLists.txt(似乎安装了boost库的地方)上设置变量

set(BOOST_ROOT /usr/include/boost/)
set(BOOST_LIBRARYDIR /usr/include/boost/regex/)

我甚至试着看看/usr/share/cmake-2.8/Modules/FindBoost.cmake文件是如何工作的,但我没有学到太多。所以我想在这里发布一个求救电话,如果有人能启发我一点的话!

我不明白的是,为什么它似乎找到了其他库,但没有找到regex库,尽管所有内容都在/usr/include/boost中boost版本是1.49(我查看了version.hpp文件内部),但在boost文档中,他们没有谈到这个版本中的regex库?我有点迷路了。

您还必须安装Boost库的头文件。CMake检查库和标头
大多数Linux发行版都将头作为-devel包提供。在你的情况下,类似boost_regex-1.49-devel

最新更新