Build with MySQL -> libmysqlclient not found
John:
./configure --help
might also be a good idea, I think it might have some options like:
--mysql-libs=/path/to/lib --mysql-includes=/path/to/include
or something similiar to use.
Unfortunately not, just the "--with-mysql" Option.
Oscar:
You might need CPPFLAGS as well. (e.g. CPPFLAGS="-I/test/core/mariadb/include") Check also "config.log" for errors.
I had already done both, just forgot to mention it. But i should have looked further.
Near the end of config.log is saw:
| /* Override any GCC internal prototype to avoid an error. | Use char because int might match the return type of a GCC | builtin and then its argument prototype would still apply. */ | #ifdef __cplusplus | extern "C" | #endif | char mysql_init (); | int | main () | { | return mysql_init (); | ; | return 0; | } configure:23386: result: noconfigure:23520: error: Can't build with MySQL support: libmysqlclient not found
================================ and thought that wouldn't help me.
Now i looked again but further up an saw:
configure:23377: gcc -o conftest -std=gnu99 -g -O2 -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -mfunction-return=keep -mindirect-branch=keep -Wall -W -Wmissing-prototypes -Wmissing-declarations> ... /usr/bin/ld: cannot find -lzcollect2: error: ld returned 1 exit status
================================
Zlib i have (of course ;) ) also compiled from source. After adding "/test/dep/zlib/include" to CPPFLAGS and "/test/dep/zlib/lib" to LDFLAGS the configuration runs without errors.
However i don't understand why the configuration-script takes the non-standard path for openssl automatically and correctly from the PKG_CONFIG_PATH, but the paths to my zlib and mariadb installations, which i also set in PKG_CONFIG_PATH not...
Oh and by the way thanks to all for help!
"Dimitri" == Dimitri dimitri_emich@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
On 2022-02-28 10:59 a.m., John Stoffel wrote:
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
I haven't seen it mentioned so sorry if this has already been done..
Ubuntu by default doesn't install development libraries when applications are installed.. So, have you done:
apt install libmariadb-dev
participants (3)
-
Daryl Richards
-
Dimitri
-
John Stoffel