I have cloned a C++ library repo called 'mlpack'. I built the library using cmake and now I want to include it to my C++ file. I am using ubuntu 19.04. I tried to run the command:
g++ -std=c++11 test.cpp -I/home/koushik/Documents/'Git Repo'/mlpack/build/lib -lmlpack -larmadillo -lboost_serialization -fopenmp
Here /home/koushik/Documents/'Git Repo'/mlpack/build/lib
is the build directory of the library. I tried this command thinking it would look for includes in that build directory. But I get the error:
test.cpp:1:10: fatal error: mlpack/core.hpp: No such file or directory
#include <mlpack/core.hpp>
^~~~~~~~~~~~~~~~~
compilation terminated.
when I try to include the library and compile code.
Apart from the above coommand I also tried
$ export LD_LIBRARY_PATH='/home/koushik/Documents/Git Repo/mlpack/build/lib'
$ g++ -std=c++11 test.cpp -lmlpack -larmadillo -lboost_serialization -fopenmp
This failed as well giving the same error as above.
I would like to clarify that I have all the other linked libraries installed via apt and they work fine when linked in other C++ files. Only mlpack is built from source and I am trying to include.