[odb-users] Linker issues during compilation with odb-mysqlLib.

Boris Kolpackov boris at codesynthesis.com
Wed Feb 23 08:26:18 EST 2022


Jannis Röglin <jannis.roeglin at psi-technics.com> writes:

> But I get when compiling linker error that external symbols cannot
> be resolved.
> 
> Following my linker input:
> C:\dependencies\odb\debug-64\lib\odb.lib;
> C:\dependencies\odb\debug-64\lib\odb-mysql.lib;
>
> 1>odb-mysql.lib(statement.lib.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "mysql_stmt_prepare" in Funktion ""private: void __cdecl odb::mysql::statement::init(unsigned __int64,enum odb::mysql::statement_kind,class odb::mysql::binding const *,bool)" (?init at statement@mysql at odb@@AEAAX_KW4statement_kind at 23@PEBVbinding at 23@_N at Z)".

I can see you've built static variants of the ODB runtime libraries. In
this case you will also need to link the MySQL runtime library. Try adding
mysqlclient.lib to the above list. Also, the correct order (which could
be important for static linking) is:

odb-mysql.lib
odb.lib
mysqlclient.lib


> Additional question:
>
> We are using c++20 for our project. Is it possible to create the .hxx
> file with c++17 and use it for a c++20 project?

Yes, I don't expect there to be any problem with this. We will also try
to add the C++20 mode support in the ODB compiler for the next beta.



More information about the odb-users mailing list