I was trying to install STXXL library to a custom path following this answer supplying prefix to cmake
this way:
cmake -DCMAKE_INSTALL_PREFIX=/usr . && make all install
When I run the tests, they seems to be working fine. But I want to include STXXL in a different MakeFile and compile that project. In that MakeFile there a line
STXXL_CONFIG = /opt/stxxl/stxxl.mk
I believe the configuration file stxxl.mk
comes from the old make
based installation (I couldn't locate it in my system either). I was wondering how I can modify this file to include STXXL library and get the custom project compiled.
Without modifying the above statement in MakeFile
, I am getting the error:
undefined reference to 'stxxl::get_next_seed()' collect2: error: ld returned 1 exit status
It goes without saying that I don't have root access and unfortunately, neither a good background with MakeFiles. This is not a duplicate of Makefile with STXXL
To use a third party C++ library from a non-standard location in GNU Make the regular steps are:
Add the path to 3rd-party library headers to your C++ preprocessor flags. E.g.
Add the path to 3rd-party shared/staric library to your linker flags and the library itself. Assuming the library is named
lib3rd-party.so
orlib3rd-party.a
, e.g.