The relevant bit on that page is
When the configure script is run without parameters, the remaining part of the process will use /usr/local/include/soci
as a default destination for SOCI header files and /usr/local/lib
as a default destination for library files
Now /usr/local/include ought to be in your default include path (e.g. try something like gcc -c -v -x c++ /dev/null -o /dev/null
to see the list your install uses) and so you can include these using
#include <soci/soci.h>
#include <soci/soci-mysql.h>
You then need to add the libraries to your link step. It looks like you'll have both static and shared versions of the libraries. You'll need to add -lsoci_core -lsoci_mysql
to your link step; however if that doesn't work then you'll also need to specify /usr/local/lib as a search directory i.e. -L/usr/local/lib -lsoci_core -lsoci_mysql
. (Again it's probably there already but you can see using gcc -print-search-dirs
.) However, the issue then is that if you're using the shared version and /usr/local/lib isn't in your distributions library search path (see /etc/ld.so.conf and/or /etc/ld.so.conf.d/*) then it won't be able to find the shared library at runtime. You'll need to either hard-code in the path to the library with the linker switch -rpath
or add /usr/local/lib to the system-wide search path as before or in your environment (variable LD_LIBRARY_PATH
). I'm not sure what the best way to do this is - I'd suggest -rpath
to avoid modifying the system in general, although if you're building a lot of libraries into /usr/local/lib it might make sense to add it.
make install
? There's no need to copy header files to your project's directory. – Sheff