【问题标题】:CMake Error: include could not find load fileCMake 错误:包含找不到加载文件
【发布时间】:2020-01-31 01:56:09
【问题描述】:

我正在尝试在项目中安装和使用库“ifopt”,但出现一些错误

我使用了以下命令 (喜欢这里:https://github.com/ethz-adrl/ifopt/blob/master/README.md):

sudo apt-get install cmake libeigen3-dev coinor-libipopt-dev
git clone https://github.com/ethz-adrl/ifopt.git
cd ifopt
mkdir build 
cd build
cmake ..
make
sudo make install

然后我添加到我的 CMakeLists:

find_package(ifopt)
add_executable(testifopt src/testifopt.cpp)
target_link_libraries(testifopt PUBLIC ifopt::ifopt_ipopt) 

这就是我得到的,使用 catkin_make:

CMake Error at /home/simone/ifopt/ifopt-config.cmake:40 (include): include could not find load file: /home/simone/ifopt/ifopt_core-targets.cmake    
Call Stack (most recent call first): push_optimal_planner/CMakeLists.txt:30 (find_package)


CMake Warning (dev) at /home/simone/ifopt/ifopt-config.cmake:44 (get_target_property):
Policy CMP0045 is not set: Error on non-existent target in
get_target_property.  Run "cmake --help-policy CMP0045" for policy details.
Use the cmake_policy command to set the policy and suppress this warning.
get_target_property() called with non-existent target "ifopt::ifopt_core".
Call Stack (most recent call first): push_optimal_planner/CMakeLists.txt:30 (find_package)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /home/simone/ifopt/ifopt-config.cmake:47 (get_property): get_property could not find TARGET ifopt::ifopt_core. Perhaps it has not yet been created.
Call Stack (most recent call first): push_optimal_planner/CMakeLists.txt:30 (find_package)

怎么了? 感谢您的帮助。

【问题讨论】:

  • And this is what i get 什么时候做什么?是什么导致了您发布的消息?这些都是你看到的消息吗?
  • 当您为 ifopt 配置 CMake 时,缺少的文件 ifopt_core-targets.cmake 和其他类似文件应该由 CMake 自动生成。你能确认这些文件存在于/home/simone/ifopt吗?
  • @squarekittles 是的,文件存在于/home/simone/ifopt/build/ifopt_core/CMakeFiles/Export/share/ifopt/cmake的文件夹中
  • @KamilCuk 我试图使用命令:“catkin_make”来构建我的项目
  • 也许你应该添加catkinros标签

标签: cmake ros catkin


【解决方案1】:

解决了,

我需要更新 Ros,重新安装 IfOpt,并且我还添加到 CMakeLists 这一行:

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_MATH_DISABLE_FLOAT128")

【讨论】:

    猜你喜欢
    • 2023-03-24
    • 2019-09-08
    • 2019-12-03
    • 1970-01-01
    • 2013-03-05
    • 1970-01-01
    • 2013-12-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多