 NickPurveyor of common sensePremium,VIP,MVM join:2000-10-29 Smithtown, NY | Can't install the DBD::mysql package on UbuntuI'm trying to install the DBD::mysql interface to have Perl scripts interface with a local MySQL database....However, I keep getting an error message when I install from CPAN:
LD_RUN_PATH="/lib/i386-linux-gnu" /usr/bin/perl myld cc -shared -O2 -g -L/usr/local/lib -fstack-protector dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.so \
-L/usr/lib -lmysqlclient -lpthread -lm -lrt -ldl \
/usr/bin/ld: cannot find -lmysqlclient
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/DBD/mysql/mysql.so] Error 1
CAPTTOFU/DBD-mysql-4.020.tar.gz
/usr/bin/make -- NOT OK
'YAML' not installed, will not store persistent state
Running make test
Can't test without successful make
Running make install
Make had returned bad status, install seems impossible
Failed during this command:
CAPTTOFU/DBD-mysql-4.020.tar.gz : make NO
What's interesting is that if I list my lib directory there's a mysql subdirectory that has the mysqlclient libraries
ubuntu-user@desktop:/usr/lib$ ls | grep mysql
libmysqlclient_r.so.16
libmysqlclient_r.so.16.0.0
libmysqlclient.so.16
libmysqlclient.so.16.0.0
mysql
-- -Stupidity, like hydrogen, is one of the basic building blocks of the Universe. -Insanity: doing the same thing over and over again and expecting different results.
Misc |
|
 SteveI know your IP addressConsultant join:2001-03-10 Yorba Linda, CA kudos:5 | The dot-so files are the shared objects that the executables load, but you still need the dot-a files to link against (the -lmysqlclient parameter).
I don't know what Ubuntu uses for packaging, but on CentOS it's the mysql-devel package. |
|
 NickPurveyor of common sensePremium,VIP,MVM join:2000-10-29 Smithtown, NY | reply to Nick ubuntu-user@desktop:/usr/lib/mysql$ ls libmygcc.a libmysqlclient.a libmysqlclient_r.a libmysqlservices.a plugin ubuntu-user@desktop:/usr/lib/mysql$
one of these? |
|
|
|
 SteveI know your IP addressConsultant join:2001-03-10 Yorba Linda, CA kudos:5 | Yes, so it's apparent that perl is not finding the libraries. I see -L/usr/lib but not -L/usr/lib/mysql in the path, so it's somehow not looking in the right places for them. I dunno how to tell the perl code to look there, but that's the gist of the issue. |
|
 NickPurveyor of common sensePremium,VIP,MVM join:2000-10-29 Smithtown, NY | reply to Nick So just to clarify, mysqlclient.a is equivalent to libmysqlclient.a? (Normally I would say no...but I haven't done a lot of Linux for a long time) |
|
 SteveI know your IP addressConsultant join:2001-03-10 Yorba Linda, CA kudos:5 | said by Nick:So just to clarify, mysqlclient.a is equivalent to libmysqlclient.a? No; the former doesn't really mean anything, while the latter (libmysqlclient.a) is summoned by -lmysqlclient on the linker command line. |
|
 MaxoYour tax dollars at work.Premium,VIP join:2002-11-04 Tallahassee, FL | reply to Nick You should be able to do this by just installing a package. I think libmysqlclient16 and libmysqlclient-dev are what you need. sudo apt-get install libmysqlclient16 libmysqlclient-dev |
|