0

I'm trying to use the SOCI library for easy MySQL access but I'm stuck at installing the library.

What I've done so far is :

  • Made the project and compiled it with CMake
  • Linked my project to the lib/release directoy that's created after compilation.
  • Linked my project to the MySQL C Connector lib directory

and here are my additional include directories : http://puu.sh/6qGNP.png

But somehow, when I compile the example program, I get a bunch of linker errors like these :

1>main.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall soci::details::standard_into_type::~standard_into_type(void)" (??1standard_into_type@details@soci@@UAE@XZ) referenced in function "public: virtual __thiscall soci::details::into_type::~into_type(void)" (??1?$into_type@H@details@soci@@UAE@XZ) 1>main.obj : error LNK2001: unresolved external symbol "protected: virtual void __thiscall soci::details::standard_into_type::post_fetch(bool,bool)" (?post_fetch@standard_into_type@details@soci@@MAEX_N0@Z)

Where did I mess up?

Halim Qarroum
  • 13,985
  • 4
  • 46
  • 71
Hatted Rooster
  • 35,759
  • 6
  • 62
  • 122
  • Against which libraries you link your application? – tumdum Jan 19 '14 at 19:18
  • here are my library links : http://puu.sh/6rqMt.png – Hatted Rooster Jan 20 '14 at 07:50
  • those are the directories, what i was asking about was which libraries (files) are you linking against. This is step "Library files" on http://en.wikibooks.org/wiki/C%2B%2B_Programming/Compiler/Linker/Libraries/Configuring_Visual_Studio – tumdum Jan 20 '14 at 16:24

1 Answers1

1

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.