【发布时间】: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”来构建我的项目
-
也许你应该添加
catkin和ros标签