How do you install SOCI correctly?

I ran into an annoying problem that kept me from programming for some time. I intend to run a personal project in which I need to use a database to store certain information, and I decided to use SQLite, but I did not like the C-ish API, so I met the SOCI shell in the SQLite wikita.

I went to the official SOCI website, read the documentation and decided to postpone it. I followed the instructions in the "Installation" chapter of the documentation and after installing all the requirements, I compiled and installed it with:

cmake -DWITH_BOOST=ON -DSOCI_TESTS=ON -DWITH_SQLITE3=ON
make
make test
sudo make install

All tests completed successfully, but when you try to run (after compiling with g++ test.cpp -o1 -lsoci_core -lsoci_sqlite3) a program such as this:

test.cpp:

#include "soci/soci.h"
#include "soci/sqlite3/soci-sqlite3.h"
#include <iostream>

int main()
{
    soci::session sql(soci::sqlite3, "testdb.db");

    return 0;    
}

: " : libsoci_sqlite3.so.3.1: : ". , , ​​ .

+5
2

, . :

strace -e open ./1 2>&1 | grep soci

:

open("/usr/local/lib/libsoci_core.so.3.1", O_RDONLY) = 3
open("/lib/x86_64-linux-gnu/tls/x86_64/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/tls/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/x86_64/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/x86_64-linux-gnu/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/x86_64/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/tls/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/x86_64/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64-linux-gnu/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/x86_64/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/tls/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/x86_64/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/lib/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/x86_64/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/tls/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/x86_64/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib/libsoci_sqlite3.so.3.1", O_RDONLY) = -1 ENOENT (No such file or directory)
./1: error while loading shared libraries: libsoci_sqlite3.so.3.1: cannot open shared object file: No such file or directory

, , /usr/local/lib/ soci_core, soci_sqlite3. , , , smylink libsoci_sqlite3.so.3.1 , , , .

+2

SOCI libs /usr/local/lib 64/

:

g++ test.cpp -o test -I/usr/local/include/soci -L/usr/local/lib64/-lsoci_core -lsoci_sqlite3\
-Wl, -rpath =/USR//lib64/

0

All Articles