From the documentation:
Required Client Libraries
The SOCI MySQL backend requires MySQL's libmysqlclient client library.
Note that the SOCI library itself depends also on libdl, so the minimum set of libraries needed to compile a basic client program is:
-lsoci_core -lsoci_mysql -ldl -lmysqlclient
This has always worked for me. If you want to link them from the build location a -L switch with the path to the libraries will need to be passed to the compiler.