I have compiled this library https://github.com/xdspacelab/openvslam successfully, but I am having trouble now including it in C++ programs.
Here is the final directory structure:
.
├── 3rd
├── build
├── camera_params
├── cmake
├── docs
├── example
├── frames
├── frames_to_localise
├── maps
├── orb_vocab
├── ros
├── src
├── test
├── videos
└── viewer
Now this is the command I used:
cd /path/to/openvslam
mkdir build && cd build
cmake \
-DBUILD_WITH_MARCH_NATIVE=ON \
-DUSE_PANGOLIN_VIEWER=OFF \
-DUSE_SOCKET_PUBLISHER=ON \
-DUSE_STACK_TRACE_LOGGER=ON \
-DBOW_FRAMEWORK=DBoW2 \
-DBUILD_TESTS=ON \
..
make -j4
As per docs, https://openvslam.readthedocs.io/en/master/installation.html#subsection-common-linux-macos
My understanding is that this install the library locally not system-wide (like in /usr/local/bin).
So I try to compile one if their examples https://github.com/xdspacelab/openvslam/blob/master/example/run_image_localization.cc
like this: g++ run_image_localization.cc
I get this error:
In file included from run_image_localization.cc:2:
./util/image_util.h:19:33: warning: defaulted function definitions are a C++11 extension [-Wc++11-extensions]
virtual ~image_sequence() = default;
^
run_image_localization.cc:10:10: fatal error: 'openvslam/system.h' file not found
#include "openvslam/system.h"
^~~~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
makes sense because openvslam
was not included. I tried different flags such as -L, -I etc but nothing worked so far. Is there a standard solution to this ?
PS: A temporary solution was to set VERBOSE = 1
while running make and copy paste the command that was used to compile the examples... That command is 40+ lines long, it takes more time to render the command on my terminal than compile the .cc file...
EDIT: I am using a Mac