使用CMake找不到boost_regex库

时间:2016-01-01 17:15:38

标签: cmake boost-regex

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

这是我命令行的调试:

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(似乎安装了升级库的地方)上设置变量

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

我甚至试图查看/usr/share/cmake-2.8/Modules/FindBoost.cmake文件是如何工作的,但我没有学到太多东西。所以我试图在这里发一个遇险呼叫,如果有人可以启发我一点点!

我不知道的是为什么它似乎找到了其他库而不是正则表达式,尽管一切都在/usr/include/boost 升级版本 1.49 (我在version.hpp文件中查看),但在提升文档中,他们在这个版本中没有谈论正则表达式库?我有点失落。

1 个答案:

答案 0 :(得分:2)

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