I am trying to compile my own scripts that use aruco (v 3.0.7) on Linux. I am using a makefile but when I compile I get this error.
[ 33%] Building CXX object CMakeFiles/aruco_simple.dir/aruco_simple.cpp.o
/home/ucfaptv/opt/aruco-3.0.7/mine/aruco_simple.cpp:2:25: fatal error: aruco/aruco.h: No such file or directory
#include <aruco/aruco.h>
^
compilation terminated.
make[2]: *** [CMakeFiles/aruco_simple.dir/aruco_simple.cpp.o] Error 1
make[1]: *** [CMakeFiles/aruco_simple.dir/all] Error 2
make: *** [all] Error 2
My CMakeLists.txt looks like this
cmake_minimum_required(VERSION 2.8)
SET(CMAKE_CXX_FLAGS "-std=c++11")
find_package(OpenCV REQUIRED PATHS "/home/ucfaptv/opt/opencv-3.4.4/build")
find_package(aruco REQUIRED PATH "/home/ucfaptv/opt/aruco-3.0.7/src")
add_library(aruco_simple SHARED aruco_simple.cpp)
target_link_libraries(aruco_simple aruco ${OpenCV_LIBS})
add_executable(run run.cpp)
target_link_libraries(run aruco_simple aruco ${OpenCV_LIBS})
add_executable(view view.cpp)
target_link_libraries(view aruco_simple aruco ${OpenCV_LIBS})
I thought find_package
should point to the aruco.h
located in /home/ucfaptv/opt/aruco-3.0.7/src
Using the same makefile (paths edited) I can compile just fine on my Mac.
I have now install aruco! A colleague pointed out that as I am installing locally (e.g. not make install
) aruco.h
in not in the directory /usr/local/include/aruco
so the include statement is now #include <aruco.h>
. I also had to edit the aruco.pc
and arucoConfig.cmake
files to point at the /home/ucfaptv/opt/aruco-3.0.7/src
directory and not at /usr/local/include