Closed mzahana closed 4 years ago
Hi @mzahana, thanks for using OsqpEigen
. My best guess at the moment would be to try linking osqp::osqp
in your application using target_link_libraries
in your CMakeLists
. If you have any link to your application, we may try to provide more insights.
@S-Dafarra thank you for your reply. I did that and still getting the error
This is what I use in the CMakeLists
find_package(OsqpEigen)
find_package(osqp REQUIRED)
.
.
.
add_executable(mpc_tracker_node
src/mpc_tracker_node.cpp
)
add_dependencies(mpc_tracker_node mpc_tracker ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
target_link_libraries(mpc_tracker_node mpc_tracker ${catkin_LIBRARIES} ${nlopt_LIBRARIES} osqp::osqp)
The error looks like:
from /home/arrow/catkin_ws/src/mavros_apriltag_tracking/src/mpc_tracker.cpp:32:
/usr/local/include/OsqpEigen/Constants.hpp:12:10: fatal error: osqp.h: No such file or directory
#include <osqp.h>
I have osqp.h
available at /usr/local/include/osqp/osqp.h
So, I got it compiled by having OsqpEigen
in find_package()
in the following way
find_package(catkin REQUIRED COMPONENTS
some_packages
.
.
.
OsqpEigen
)
It compiled without having to link osqp::osqp
Up to now, I just included the #include <OsqpEigen/OsqpEigen.h>
. Didn't do anything else as I wanted to make sure the include is OK.
So, I got it compiled by having
OsqpEigen
infind_package()
in the following wayfind_package(catkin REQUIRED COMPONENTS some_packages . . . OsqpEigen )
It compiled without having to link
osqp::osqp
Up to now, I just included the
#include <OsqpEigen/OsqpEigen.h>
. Didn't do anything else as I wanted to make sure the include is OK.
Sounds good! Then probably OsqpEigen::OsqpEigen
was missing as a target to link.
@mzahana if this is no more an issue, feel free to close it.
Hi.
I installed
osqp
from source as described here. Then, I installedosqp-eigen
. I installed both system wide.I am using
catkin build
to build my applications. In my CMakeLists.txt, I set the following,I use the following include in my header file
When I try to compile, I get
Any advice on how to solve this issue?
Thanks.