Subject: | Wrong lib path during install (Mac OS X 10.4.9, Perl 5.8.6, MySQL 5.0.41) |
After running
perl Makefile.PL
make
make test
I got the error:
install_driver(mysql) failed: Can't load
'/private/var/root/.cpan/build/DBD-mysql-4.005-9Lhbsu/blib/arch/auto/DBD/mysql/mysql.bundle'
for module DBD::mysql:
dlopen(/private/var/root/.cpan/build/DBD-mysql-4.005-9Lhbsu/blib/arch/auto/DBD/mysql/mysql.bundle,
2): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
Referenced from:
/private/var/root/.cpan/build/DBD-mysql-4.005-9Lhbsu/blib/arch/auto/DBD/mysql/mysql.bundle
The problem is that the file
"/usr/local/mysql/lib/mysql/libmysqlclient.15.dylib" does not exist. The
correct is "/usr/local/mysql/lib/libmysqlclient.15.dylib".
The workaround is to create the symbolic link
"/usr/local/mysql/lib/mysql" pointing to "/usr/local/mysql/lib".
ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql
The funny thing is that mysql.bundle compilation looks for the wrong
path even when I specify a different location:
perl Makefile.PL --libs='-L/usr/local/mysql/lib -lmysqlclient -lz -lm'
That's why I'm reporting this bug -- the configuration shouldn't "guess"
the path if we have given a value.