[odb-users] Undefined symbols

Adnan RIHAN adnan at rihan.fr
Thu Sep 25 10:38:48 EDT 2014


Hi there !

After having a hard time making odb and everything work, I’m trying to compile a Qt project, with few odb lines (using libodb-qt and libodb-sqlite).

Here is my error:
> Undefined symbols for architecture x86_64:
>   "odb::sqlite::database::database(std::string const&, int, bool, std::string const&, odb::details::transfer_ptr<odb::sqlite::connection_factory>)", referenced from:
>       MasterController::createDb() in MasterController.o
> ld: symbol(s) not found for architecture x86_64

Starting with the .pro file, the libodb lib and libodb-sqlite libs are correctly sent to gcc (clang) on compilation:
> INCLUDEPATH +=  /usr/local/include
> LIBS        +=  -L/usr/local/lib -lodb -lodb-qt -lodb-sqlite

Now my code:
> #include <odb/database.hxx>
> #include <odb/transaction.hxx>
> #include <odb/sqlite/database.hxx>

> #include "Models/Category/Category.hpp" // My model with #pragmas
> #include "Models/Category/Category-odb.hxx" // The generated code, by odb

And the failing code:
> odb::database	*db(new odb::sqlite::database(":memory:"));

Could anyone tell me what did I do wrong please ?
--  
Cordialement, Adnan RIHAN.
Directeur-Gérant de Eolis-Software, société de services informatiques.  

GPG: 5675-62BA (https://keybase.io/max13/key.asc)
-> Si vous n’utilisez pas GPG mais souhaitez quand même m’envoyer un e-mail chiffré: (https://encrypt.to/0x567562BA).



More information about the odb-users mailing list