| Bug #41775 | cannot find -lmysqlclient | ||
|---|---|---|---|
| Submitted: | 29 Dec 2008 2:31 | Modified: | 31 Dec 2008 4:04 |
| Reporter: | Simon Stassen | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | MySQL Server: Installing | Severity: | S3 (Non-critical) |
| Version: | 5.1.30 | OS: | Linux (Ubuntu 8.10 32bit, RedHat5) |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | ./configure | ||
[29 Dec 2008 6:03]
Sveta Smirnova
Thank you for the report. Please indicate accurate version of your operating system, if it is 64-bit or not and accurate version of MySQL package you run (file name of MySQL package you downloaded).
[29 Dec 2008 6:24]
Simon Stassen
Thanks for the prompt response. I'm running Ubuntu 8.10 32bit, with mysql-5.1.30-linux-powerpc-glibc23
[29 Dec 2008 7:55]
Sveta Smirnova
Thank you for the feedback. Just to be sure: is your machine powerpc?
[29 Dec 2008 10:12]
Simon Stassen
I'm not sure - it's a normal dell. Does this make a difference?
[29 Dec 2008 10:21]
Sveta Smirnova
Thank you for the feedback. > I'm not sure - it's a normal dell. Does this make a difference? Yes, if your computer is usual x86 described behavior is expected. You should use mysql-5.1.30-linux-i686* binaries in this case.
[29 Dec 2008 10:22]
Sveta Smirnova
uname -a output should contain information about architecture.
[29 Dec 2008 10:41]
Simon Stassen
I tested mysql with the following wich seemed to work fine: mysql -u root mysql> Mysql>SHOW DATABASES; output mysql>USE mysql; output mysql>SHOW TABLES; output mysql>SELECT COUNT(*) FROM user; output
[29 Dec 2008 10:43]
Simon Stassen
uname -a Linux ubuntu 2.6.27-9-generic #1 SMP Thu Nov 20 21:57:00 UTC 2008 i686 GNU/Linux
[29 Dec 2008 10:45]
Simon Stassen
Thank you very much, I will try the other version. Should I remove this version first? And how do I do this?
[29 Dec 2008 10:54]
Sveta Smirnova
Thank you for the feedback. > Thank you very much, I will try the other version. Should I remove this version first? To test if libraries work you can just unpack *tar.gz package into some directory and try to compile PHP, but if you don't uninstall previous version you should handle library conflicts in feature. So probably best scenario: try *tar.gz package in some temporary directory, be sure it works and PHP can be compiled, then uninstall powerpc version, then re-install i686 version. > And how do I do this? This depends from how you installed: if you used package manager, consult its documentation, for *tar.gz packages just replace old files with new ones.
[29 Dec 2008 10:59]
Simon Stassen
Thank you very much Sveta, your response was very professional and very quick!
[29 Dec 2008 11:00]
Simon Stassen
Just to change the status
[30 Dec 2008 8:23]
Simon Stassen
I tried mysql-5.1.30-linux-i686-glibc23 but it has the same affect. Do you have any other ideas what could be causing this?
[30 Dec 2008 10:24]
Sveta Smirnova
Thank you for the feedback. Usually this error happens when one uses libraries which are not compatible with the platform she is building for. Most common case: cross-host building on 64-bit platform for 32-bit machine. But if you use 32-bit machine and 32-bit packages this should not be the case. I'll leave status of the report "Open", so we can try to find same machine as you use and try to repeat the error. Please, check on your side which exact compiler do you use (version #) and if you have predefined CFLAGS and LDFLAGS (full config.log can be helpful).
[31 Dec 2008 4:04]
Simon Stassen
Thanks again for your patience Sveta. I seem to have been able to get it to work by installing both php and mysql using apt-get install. Your help is much appreciated.
[26 Sep 2009 4:46]
Roel Van de Paar
Usually seen as: /usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient.so when searching for -lmysqlclient /usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient.a when searching for -lmysqlclient /usr/bin/ld: cannot find -lmysqlclient

Description: configure: failed program was: #line 60235 "configure" #include "confdefs.h" How to repeat: install mysql test it - works download php-5.2.8.tar.gz run tar -xzvf /tmp/php-5.2.8.tar.gz run cd php-5.2.8 run ./configure --prefix=/usr/local/php5 --with-apxs=/usr/local/apache/bin/apxs --with-libxml- dir=/usr/local/lib --with-zlib --with-zlib-dir=/usr/local/lib --with-mysql=/usr/local/mysql result ... checking for MySQL UNIX socket location... no checking for mysql_close in -lmysqlclient... no checking for mysql_error in -lmysqlclient... no configure: error: mysql configure failed. Please check config.log for more information. config log int main() { mysql_close() ; return 0; } configure:60227: checking for mysql_error in -lmysqlclient configure:60246: gcc -o conftest -I/usr/include -g -O2 -Wl,-rpath,/usr/local/mysql/lib -L/usr/local/mysql/lib -L/usr/lib -Wl,-rpath,/usr -L/usr conftest.c -lmysqlclient -lz -lz -lresolv -lm -ldl -lnsl -lxml2 -lxml2 1>&5 /usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient.so when searching for -lmysqlclient /usr/bin/ld: skipping incompatible /usr/local/mysql/lib/libmysqlclient.a when searching for -lmysqlclient /usr/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status configure: failed program was: #line 60235 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char mysql_error(); int main() { mysql_error() ; return 0; }