Bug #13902: ld: "cannot find -lmysqlclient" (-L flag missing)
| From: | jasonw at rpdesign dot com | Date: | Thu, 01 Nov 2001 21:44:22 +0000 |
| Subject: | Bug #13902: ld: "cannot find -lmysqlclient" (-L flag missing) | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-69502@lists.php.net to get a copy of this message | ||
From: jasonw@rpdesign.com
Operating system: RedHat Linux 2.4.7-10 #1 i686
PHP version: 4.0.6
PHP Bug Type: Unknown/Other Function
Bug description: ld: "cannot find -lmysqlclient" (-L flag missing)
Short version:
I ran ./configure with --with-mysql=/usr (among other things... see
below)
I got a compiler error (output below) that said "cannot find
-lmysqlclient".
I believe this is because the compile command (below) should contain
"-L/usr/lib/mysql". this flag is in config_vars.mk as follows:
MYSQL_LIBS = -L/usr/lib/mysql -lmysqlclient -L/usr -z
I also found this line in config_vars.mk:
PHP_RPATHS = /usr/lib/mysql
I wonder if that should have a -L in it...
------------
Solution (ok hack...)
------------
I got php to compile by adding -L/usr/lib/mysql to the following line in
config_vars.mk starting with "EXTRA_LIBS = "
---------------
References
---------------
Firstly, all the options I passed to ./configure:
./configure 'i386-redhat-linux' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc'
'--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--localstatedir=/var'
'--sharedstatedir=/usr/com' '--mandir=/usr/share/man'
'--infodir=/usr/share/info' '--prefix=/usr'
'--with-config-file-path=/etc'
'--disable-debug' '--enable-pic' '--disable-rpath'
'--enable-inline-optimization' '--with-apxs=/usr/sbin/apxs'
'--with-bz2'
'--with-curl' '--with-db3' '--with-dom'
'--with-exec-dir=/usr/bin'
'--with-gd' '--with-gdbm' '--with-gettext'
'--with-jpeg-dir=/usr'
'--with-mm' '--with-openssl' '--with-png'
'--with-regex=system'
'--with-ttf' '--with-zlib' '--with-layout=GNU'
'--enable-debugger'
'--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode'
'--enable-sockets' '--enable-sysvsem' '--enable-sysvshm'
'--enable-track-vars' '--enable-yp' '--enable-wddx'
'--with-mysql=/usr'
'--without-unixODBC' '--without-oracle' '--without-oci8'
'--with-xml'
Seccondly, the relivant bit of the output from make:
Making all in .
make[1]: Entering directory `/home/jason/software/php-4.0.6'
/bin/sh /home/jason/software/php-4.0.6/libtool --silent --mode=link gcc
-I. -I/home/jason/software/php-4.0.6/
-I/home/jason/software/php-4.0.6/main/home/jason/software/php-4.0.6
-I/usr/include/apache -I/home/jason/software/php-4.0.6/Zend -I/include
-I/usr/include/mysql -I/home/jason/software/php.0.6/ext/xml/expat/xmltok
-I/home/jason/software/php-4.0.6/ext/xml/expat/xmlparse
-I/home/jason/software/php-4.0.6/TSRM -DLINUX=22 -DEAPI -DEAPI_MMUSE_EXPAT
-DEAPI_MM_CORE_PATH=/var/run/httpd.mm -DSUPPORT_UTF8 -DXML_BYTE_ORDER=12 -g
-O2 -o libphp4.la -rpath /home/jason/software/php-4.0.6/libsvoid-version
/usr/lib/mysql stub.lo Zend/libZend.la sapi/apache/libsapi.la
main/libmain.la ext/zlib/libzlib.la ext/bz2/libbz2.la ext/curl/libcurl.
ext/dba/libdba.la ext/domxml/libdomxml.la ext/ftp/libftp.la ext/gd/libgd.la
ext/gettext/libgettext.la ext/mysql/libmysql.la
ext/openssl/libopenssl.lext/pcre/libpcre.la ext/posix/libposix.la
ext/session/libsession.la ext/sockets/libsockets.la
ext/standard/libstandard.la ext/sysvsem/libsysvsem.la
e/sysvshm/libsysvshm.la ext/wddx/libwddx.la ext/xml/libxml.la
ext/yp/libyp.la TSRM/libtsrm.la -lpam -ldl -lmm -lmysqlclient -lz -lgd
-ljpeg -lz -lxml2ldb -lgdbm -lcurl -ldl -lcrypto -lssl -lbz2 -lz -lcrypt
-lssl -lcrypto -lresolv -lm -ldl -lnsl -lresolv
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
--
Edit bug report at: http://bugs.php.net/?id=13902&edit=1