C Client Lib 2.0.0 Link error on Win MS-VS2013?

Asked by Thomas Gessl on 2014-08-28

Dear colleagues,
I try to connect a C++ application to MariaDB and using MariaDB C Client Library but getting strange Linker errors.
Env: Win8.1, MS-Visual Studio 2013, MariaDB C Client Library 2.0.0 stable, targetting a native MFC 32bit app.

4>libcmtd.lib(strtoq.obj) : error LNK2005: _strtoll already defined in mariadbclient.lib(strtoll.obj)
4>C:\Projects\Proj\Debug\MyApp.exe : fatal error LNK1169: one or more multiply defined symbols found

When I do a "Ignore specific default libraries" with libcmtd.lib in the projects linker settings, 275 other errors in various libs apears:
....
4>mariadbclient.lib(violite.obj) : error LNK2001: unresolved external symbol _sprintf
4>mariadbclient.lib(my_init.obj) : error LNK2001: unresolved external symbol _sprintf
4>mariadbclient.lib(my_stmt_codec.obj) : error LNK2001: unresolved external symbol _sprintf
4>mariadbclient.lib(libmariadb.obj) : error LNK2019: unresolved external symbol _getenv referenced in function _read_user_name
4>mariadbclient.lib(my_init.obj) : error LNK2001: unresolved external symbol _getenv
....
4>libcpmtd.lib(xtowupper.obj) : error LNK2001: unresolved external symbol ___crtLCMapStringW
4>libcpmtd.lib(xstopfx.obj) : error LNK2019: unresolved external symbol _isxdigit referenced in function __Stopfx
4>libcpmtd.lib(xstopfx.obj) : error LNK2019: unresolved external symbol _isalnum referenced in function __Stopfx
4>OLDNAMES.lib(read.obj) : error LNK2001: unresolved external symbol __read
4>LINK : error LNK2001: unresolved external symbol __load_config_used
4>C:\Projects\Proj\Debug\MyApp.exe : fatal error LNK1120: 275 unresolved externals

Does anybody know how to fix this problem?
Thank you in advance,
Thomas Gessl

Question information

Language:
English Edit question
Status:
Solved
For:
MariaDB Edit question
Assignee:
No assignee Edit question
Solved by:
Thomas Gessl
Solved:
2014-08-28
Last query:
2014-08-28
Last reply:
Thomas Gessl (t-gessl) said : #1

I solved this problem for me.
Instead of linking with the static library (mariadbclient.lib) I will use the dynamic library (libmariadb.lib) and the corresponding libmariadb.dll.
And here the application builds without any problems.
This solution works for me.

Have a nice day
regards,
Thomas