QiBuild/CMake cannot not find BOOST_FILESYSTEM

QiBuild/CMake cannot not find BOOST_FILESYSTEM

本文关键字:BOOST FILESYSTEM find not CMake cannot QiBuild      更新时间:2023-10-16

我正试图从Aldebaran构建C++示例,如helloworld和sayhelloworlds,但qiBuild一直说找不到BOOST_FILESYSTEM。Boost已经安装并运行,我在Visual Studio中的其他一些项目中对它进行了测试。

这是运行qibuild configure -c atom1145:后的错误

[WARN ]:  Nested worktrees detected:
d:ald_sdknaoqi-sdk-1.14.5-win32-vs2010docexamples is already in a worktree
(in d:ald_sdk)
Current build worktree: d:ald_sdknaoqi-sdk-1.14.5-win32-vs2010docexamples
Using toolchain: atom1145
Build type: Debug
* (1/1) Configuring sayhelloworld
-- Using qibuild 3.7.1
-- Binary: sayhelloworld
CMake Error at D:/Programs/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find BOOST_FILESYSTEM (missing: BOOST_FILESYSTEM_LIBRARIES)
Call Stack (most recent call first):
  D:/Programs/CMake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
  d:/Programs/Python27/share/cmake/qibuild/find.cmake:361 (find_package_handle_standard_args)
  d:/Programs/Python27/share/cmake/qibuild/find.cmake:269 (_qi_call_fphsa)
  d:/Programs/Python27/share/cmake/qibuild/modules/boostutils.cmake:39 (export_lib)
  d:/Programs/Python27/share/cmake/qibuild/modules/boost_filesystem-config.cmake:9 (boost_flib)
  d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:80 (find_package)
  d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:94 (_qi_use_lib_get_deps)
  d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:94 (_qi_use_lib_get_deps)
  d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:94 (_qi_use_lib_get_deps)
  d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:94 (_qi_use_lib_get_deps)
  d:/Programs/Python27/share/cmake/qibuild/internal/uselib.cmake:158 (_qi_use_lib_get_deps)
  d:/Programs/Python27/share/cmake/qibuild/stage.cmake:246 (_qi_use_lib_internal)
  CMakeLists.txt:17 (qi_use_lib)

-- Configuring incomplete, errors occurred!
See also "D:/ALD_SDK/naoqi-sdk-1.14.5-win32-vs2010/doc/examples/core/sayhelloworld/build-atom1145/CMakeFiles/CMakeOutput.log".
See also "D:/ALD_SDK/naoqi-sdk-1.14.5-win32-vs2010/doc/examples/core/sayhelloworld/build-atom1145/CMakeFiles/CMakeError.log".
[ERROR]:  ConfigureFailed Error occurred when configuring project sayhelloworld

Boost编译后,我得到了以下路径:

The following directory should be added to compiler include paths:
    D:/Programs/boost_1_57_0
The following directory should be added to linker library paths:
    D:Programsboost_1_57_0stagelib

这些不是默认路径,我想这会引起一些问题。

在CMakeCache.txt中,我发现Boost条目被"清除":

//The directory containing a CMake configuration file for BOOST.
BOOST_DIR:PATH=d:/Programs/Python27/share/cmake/qibuild/modules
//The directory containing a CMake configuration file for BOOST_FILESYSTEM.
BOOST_FILESYSTEM_DIR:PATH=d:/Programs/Python27/share/cmake/qibuild/modules
//Cleared.
BOOST_FILESYSTEM_EXECUTABLE:STRING=
//Cleared.
BOOST_FILESYSTEM_EXECUTABLE_DEBUG:STRING=
//Cleared.
Boost_DEFINITIONS:STRING=
//Cleared.
Boost_EXECUTABLE:STRING=
//Cleared.
Boost_EXECUTABLE_DEBUG:STRING=
//Boost filesystem library (debug)
Boost_FILESYSTEM_LIBRARY_DEBUG:FILEPATH=Boost_FILESYSTEM_LIBRARY_DEBUG-NOTFOUND
//Boost filesystem library (release)
Boost_FILESYSTEM_LIBRARY_RELEASE:FILEPATH=Boost_FILESYSTEM_LIBRARY_RELEASE-NOTFOUND
//Path to a file.
Boost_INCLUDE_DIR:PATH=D:/ALD_SDK/naoqi-sdk-1.14.5-win32-vs2010/include
//Cleared.
Boost_INCLUDE_DIRS:STRING=
//Cleared.
Boost_LIBRARIES:STRING=

我试着像这样在CMakeLists.txt中添加一些变量,但没有帮助:

set(Boost_DEBUG true)
set(BOOST_ROOT "D:/Programs/boost_1_57_0")
set(BOOST_INCLUDEDIR "D:/Programs/boost_1_57_0/boost")
set(BOOST_LIBRARYDIR "D:/Programs/boost_1_57_0/stage/lib")

任何帮助都将不胜感激!

这是Aldebaran支持的解决方案:

NAOqi 1.14.5 windows C++SDK与最新版本的qibuild之间似乎存在一些不兼容之处。

在我这边,我用最新版本的qibuild进行了测试,它给了我和你相同的错误。

我现在让我们的团队更新文档。同时,我可以向您提出一个解决方法,即使用pip uninstall qibuild并重新安装适用于windows 的NAOqi 1.14.5 C++SDK版本

pip install qibuild==3.5.1

这个应该有效。