Build with MySQL -> libmysqlclient not found

John Stoffel john at stoffel.org
Mon Feb 28 15:59:29 UTC 2022


>>>>> "Dimitri" == Dimitri  <dimitri_emich at protonmail.com> writes:

Dimitri>     John:
Dimitri>     ./configure --help
   
Dimitri>     might also be a good idea, I think it might have some options like:
   
Dimitri>     --mysql-libs=/path/to/lib
Dimitri>     --mysql-includes=/path/to/include
   
Dimitri>     or something similiar to use.

Dimitri> Unfortunately not, just the "--with-mysql" Option.

Dimitri>     Oscar:
Dimitri>     You might need CPPFLAGS as well. (e.g. CPPFLAGS="-I/test/core/mariadb/include")
Dimitri>     Check also "config.log" for errors.

Dimitri> I had already done both, just forgot to mention it.
Dimitri> But i should have looked further.

Dimitri> Near the end of config.log is saw:
Dimitri> ================================

Dimitri>     | /* Override any GCC internal prototype to avoid an error.
Dimitri>     |    Use char because int might match the return type of a GCC
Dimitri>     |    builtin and then its argument prototype would still apply.  */
Dimitri>     | #ifdef __cplusplus
Dimitri>     | extern "C"
Dimitri>     | #endif
Dimitri>     | char mysql_init ();
Dimitri>     | int
Dimitri>     | main ()
Dimitri>     | {
Dimitri>     | return mysql_init ();
Dimitri>     |   ;
Dimitri>     |   return 0;
Dimitri>     | }
Dimitri>     configure:23386: result: no
Dimitri>     configure:23520: error: Can't build with MySQL support: libmysqlclient not found

Dimitri> ================================
Dimitri> and thought that wouldn't help me.

Dimitri> Now i looked again but further up an saw:
Dimitri> ================================

Dimitri>     configure:23377: gcc -o conftest -std=gnu99 -g -O2 -fstack-protector-strong -U_FORTIFY_SOURCE
Dimitri>     -D_FORTIFY_SOURCE=2 -mfunction-return=keep -mindirect-branch=keep -Wall -W
Dimitri>     -Wmissing-prototypes -Wmissing-declarations> ...
Dimitri>     /usr/bin/ld: cannot find -lz
Dimitri>     collect2: error: ld returned 1 exit status

Dimitri> ================================

Dimitri> Zlib i have (of course ;) ) also compiled from source.
Dimitri> After adding "/test/dep/zlib/include" to CPPFLAGS and "/test/dep/zlib/lib" to LDFLAGS the
Dimitri> configuration runs without errors.

Dimitri> However i don't understand why the configuration-script takes
Dimitri> the non-standard path for openssl automatically and correctly
Dimitri> from the PKG_CONFIG_PATH, but the paths to my zlib and
Dimitri> mariadb installations, which i also set in PKG_CONFIG_PATH
Dimitri> not...

I suspect that either the configure setup scripts doesn't support
using pkg-config for mysql/mariadb, or that there's a problem with how
it works.

In any case, it's good to see you got this working for yourself.  It
might also be that the configure.ac needs to be setup so that mariadb
depends on libz being found and complaining/failing if not.

Cheers,
John


More information about the dovecot mailing list