ld cannot find libmysqlclient - mysql

I remember, years ago when I started using mySQL, it was a nightmare to set up things "just so," so that the libraries were found (especially mySQL libraries!). In my case, I believe ldconfig was the tool that sorted things out. Flash forward to 2012 - have just installed a new "primary" system that includes 64-bit Ubuntu 12.04, and I'm in the process of making sure all my sources will compile. Imagine my surprise that I'm back in the same boat with libmysqlclient.
My web searches have revealed much to try, nothing that helps. Along the way, I found this trick: gcc ... mysql_config --cflags --libs - very nice, but that didn't help.
So, for example, the result of:
gcc -D_FILE_OFFSET_BITS=64 `mysql_config --cflags --libs` \
-o check-my-ip \
-s check-my-ip.c ../common/ini-file.c
is
/tmp/ccxAgCqr.o: In function `updateTables':
/usr/local/src/check-my-ip/check-my-ip.c:373: undefined reference to `mysql_init'
/usr/local/src/check-my-ip/check-my-ip.c:374: undefined reference to `mysql_real_connect'
/usr/local/src/check-my-ip/check-my-ip.c:381: undefined reference to `mysql_error'
/usr/local/src/check-my-ip/check-my-ip.c:381: undefined reference to `mysql_errno'
/usr/local/src/check-my-ip/check-my-ip.c:397: undefined reference to `mysql_field_count'
/usr/local/src/check-my-ip/check-my-ip.c:398: undefined reference to `mysql_use_result'
/usr/local/src/check-my-ip/check-my-ip.c:399: undefined reference to `mysql_fetch_row'
/usr/local/src/check-my-ip/check-my-ip.c:419: undefined reference to `mysql_free_result'
/usr/local/src/check-my-ip/check-my-ip.c:422: undefined reference to `mysql_field_count'
/usr/local/src/check-my-ip/check-my-ip.c:429: undefined reference to `mysql_close'
/tmp/ccxAgCqr.o: In function `myQuery':
/usr/local/src/check-my-ip/check-my-ip.c:439: undefined reference to `mysql_query'
/usr/local/src/check-my-ip/check-my-ip.c:441: undefined reference to `mysql_error'
/tmp/ccxAgCqr.o: In function `indexExists':
/usr/local/src/check-my-ip/check-my-ip.c:464: undefined reference to `mysql_field_count'
/usr/local/src/check-my-ip/check-my-ip.c:465: undefined reference to `mysql_use_result'
/usr/local/src/check-my-ip/check-my-ip.c:466: undefined reference to `mysql_fetch_row'
/usr/local/src/check-my-ip/check-my-ip.c:471: undefined reference to `mysql_free_result'
collect2: ld returned 1 exit status
make: *** [check-my-ip] Error 1
Output from mysql_config --cflags --libs is:
-I/usr/include/mysql -DBIG_JOINS=1 -fno-strict-aliasing -g
-L/usr/lib/x86_64-linux-gnu -lmysqlclient -lpthread -lz -lm -lrt -ldl
These are some other commands that may be helpful in diagnosis:
$ ldconfig -p | grep mysql
libmysqlclient.so.18 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
libmysqlclient.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libmysqlclient.so
$ ls -l /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18
lrwxrwxrwx 1 root root 24 Jun 11 10:21 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18 -> libmysqlclient.so.18.0.0
$ ls -l /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
-rw-r--r-- 1 root root 3408136 Jun 11 10:21 /usr/lib/x86_64-linux-gnu/libmysqlclient.so.18.0.0
I did an aptitude search libmysql and noted that there are 37 lines, most of which have the i386 designation (like: libmysqld-pic:i386),
and I notice that there are zero lines with x86_64 (or -64) in that output; is that part of the problem? (Here are those 37 lines)
$ aptitude search libmysql
p libmysql++-dev - MySQL C++ library bindings (development)
p libmysql++-dev:i386 - MySQL C++ library bindings (development)
p libmysql++-doc - MySQL C++ library bindings (documentation and exampl
p libmysql++3 - MySQL C++ library bindings (runtime)
p libmysql++3:i386 - MySQL C++ library bindings (runtime)
p libmysql-cil-dev - MySQL database connector for CLI
p libmysql-diff-perl - module for comparing the table structure of two MySQ
p libmysql-java - Java database (JDBC) driver for MySQL
p libmysql-ocaml - OCaml bindings for MySql
p libmysql-ocaml:i386 - OCaml bindings for MySql
p libmysql-ocaml-dev - OCaml bindings for MySql
p libmysql-ocaml-dev:i386 - OCaml bindings for MySql
v libmysql-ocaml-dev-dnim6:i386 -
v libmysql-ocaml-dev-jygp6 -
v libmysql-ocaml-dnim6:i386 -
v libmysql-ocaml-jygp6 -
p libmysql-ruby - Transitional package for ruby-mysql
v libmysql-ruby:i386 -
p libmysql-ruby1.8 - Transitional package for ruby-mysql
v libmysql-ruby1.8:i386 -
p libmysql-ruby1.9.1 - Transitional package for ruby-mysql
v libmysql-ruby1.9.1:i386 -
p libmysql6.4-cil - MySQL database connector for CLI
i libmysqlclient-dev - MySQL database development files
p libmysqlclient-dev:i386 - MySQL database development files
v libmysqlclient15-dev -
v libmysqlclient15-dev:i386 -
i A libmysqlclient18 - MySQL database client library
p libmysqlclient18:i386 - MySQL database client library
p libmysqlcppconn-dev - MySQL Connector for C++ (development files)
p libmysqlcppconn-dev:i386 - MySQL Connector for C++ (development files)
p libmysqlcppconn5 - MySQL Connector for C++ (library)
p libmysqlcppconn5:i386 - MySQL Connector for C++ (library)
i libmysqld-dev - MySQL embedded database development files
p libmysqld-dev:i386 - MySQL embedded database development files
p libmysqld-pic - MySQL database development files
p libmysqld-pic:i386 - MySQL database development files
Here's the content of /usr/lib/mysql
$ find /usr/lib/mysql
/usr/lib/mysql
/usr/lib/mysql/plugin
/usr/lib/mysql/plugin/qa_auth_client.so
/usr/lib/mysql/plugin/auth.so
/usr/lib/mysql/plugin/qa_auth_server.so
/usr/lib/mysql/plugin/semisync_master.so
/usr/lib/mysql/plugin/libdaemon_example.so
/usr/lib/mysql/plugin/ha_example.so
/usr/lib/mysql/plugin/adt_null.so
/usr/lib/mysql/plugin/auth_test_plugin.so
/usr/lib/mysql/plugin/auth_socket.so
/usr/lib/mysql/plugin/qa_auth_interface.so
/usr/lib/mysql/plugin/semisync_slave.so
/usr/lib/mysql/plugin/mypluglib.so
I don't know what else to try, where else to look, and would appreciate any pointers.

Linker flags should always be specified last:
gcc -D_FILE_OFFSET_BITS=64 `mysql_config --cflags` \
-o check-my-ip \
-s check-my-ip.c ../common/ini-file.c \
`mysql_config --libs`

Related

lua require "luasql.mysql" occurs error loading module infomation

i want to use mysql in lua program. But when run require "luasql.mysql",
throws error infomation
error loading module 'luasql.mysql' from file '/usr/local/luarocks/lib/lua/5.4/luasql/mysql.so':
/usr/local/luarocks/lib/lua/5.4/luasql/mysql.so:1: unexpected symbol near '<\207>'
stack traceback:
[C]: in ?
[C]: in function 'require'
stdin:1: in main chunk
[C]: in ?
I install lua and mysql by brew.
which lua is /opt/homebrew/bin/lua, lua -v is Lua 5.4.3 Copyright (C) 1994-2021 Lua.org, PUC-Rio
which mysql is /opt/homebrew/bin/mysql, mysql -V is mysql Ver 8.0.23 for osx10.16 on x86_64 (Homebrew)
install luarocks by luarocks source code, this is the source code website (https://luarocks.github.io/luarocks/releases/ ), luarocks --version is
/usr/local/luarocks/bin/luarocks 3.9.1
LuaRocks main command-line interface
which luarocks is /usr/local/bin/luarocks
Install luasql-mysql by command
luarocks install luasql-mysql MYSQL_INCDIR=/opt/homebrew/Cellar/mysql/8.0.23_1/include/mysql MYSQL_LIBDIR=/opt/homebrew/Cellar/mysql/8.0.23_1/lib
and then the result is
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -O2 -fPIC -I/opt/homebrew/include/lua5.4 -c src/luasql.c -o src/luasql.o -I/opt/homebrew/Cellar/mysql/8.0.23_1/include/mysql
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -O2 -fPIC -I/opt/homebrew/include/lua5.4 -c src/ls_mysql.c -o src/ls_mysql.o -I/opt/homebrew/Cellar/mysql/8.0.23_1/include/mysql
env MACOSX_DEPLOYMENT_TARGET=11.0 gcc -bundle -undefined dynamic_lookup -all_load -o luasql/mysql.so src/luasql.o src/ls_mysql.o -L/opt/homebrew/Cellar/mysql/8.0.23_1/lib -lmysqlclient
luasql-mysql 2.6.0-1 is now installed in /usr/local/luarocks (license: MIT/X11)
run luarocks list, the result is
Rocks installed for Lua 5.4
---------------------------
luarocks
3.9.1-1 (installed) - /usr/local/luarocks/lib/luarocks/rocks-5.4
luasql-mysql
2.6.0-1 (installed) - /usr/local/luarocks/lib/luarocks/rocks-5.4
I config export LUA_PATH="/usr/local/luarocks/lib/lua/5.4/?.so;;" in .zshrc profile. When execute print(package.path), the output is
/usr/local/luarocks/lib/lua/5.4/?.so;/opt/homebrew/share/lua/5.4/?.lua;/opt/homebrew/share/lua/5.4/?/init.lua;/opt/homebrew/lib/lua/5.4/?.lua;/opt/homebrew/lib/lua/5.4/?/init.lua;./?.lua;./?/init.lua
so run require "luasql.mysql", i don't know the reason about
error loading module...
how should i solve this problem, is anyone knows?
i expected anyone else tell me how to solve this problem

Installing luasql-mysql in Windows 10: cannot find -lmysqlclient

I try to install luasql-mysql with luarocks (Lua 5.3.5, LuaRocks 3.0.3). I have Mysql Connector C 6.1 installed in directory "C:\Program Files\MySQL\MySQL Connector C 6.1". I have MinGW installed in C:\TDM-GCC-64 dir.
When I run command
luarocks --from=http://rocks.luarocks.org/dev install luasql-mysql cvs-1 MYSQL_INCDIR="C:\mysql-5.7.23-winx64\include" MYSQL_LIBDIR="C:\Program Files\MySQL\Connector C++ 8.0\lib64"
I get the error
Cloning into 'luasql'...
remote: Enumerating objects: 122, done.
remote: Counting objects: 100% (122/122), done.
remote: Compressing objects: 100% (92/92), done.
remote: Total 122 (delta 46), reused 55 (delta 16), pack-reused 0
Receiving objects: 100% (122/122), 94.79 KiB | 197.00 KiB/s, done.
Resolving deltas: 100% (46/46), done.
C:\TDM-GCC-64\bin\gcc.exe -O2 -c -o src/luasql.o -IC:\lua\include src/luasql.c -IC:\mysql-5.7.23-winx64\include
C:\TDM-GCC-64\bin\gcc.exe -O2 -c -o src/ls_mysql.o -IC:\lua\include src/ls_mysql.c -IC:\mysql-5.7.23-winx64\include
C:\TDM-GCC-64\bin\gcc.exe -shared -o luasql/mysql.dll src/luasql.o src/ls_mysql.o -LC:\Program Files\MySQL\Connector C++ 8.0\lib64 -lmysqlclient C:\lua\bin/lua53.dll -lm
C:/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmysqlclient
collect2.exe: error: ld returned 1 exit status
How to specify paths correctly?
I could find workaround solution. Here is steps to make Lua 5.1 running in Windows 10 x64 Pro connect to Mysql server:
Get the latest Lua 5.1 from https://code.google.com/archive/p/luaforwindows/downloads
Install it. I have to remove all previous Lua and LuaRocks installations in my workstation
Added environment variable LUA_CPATH with value:
C:\Program Files (x86)\Lua\5.1\clibs\?.dll;C:\Program Files (x86)\Lua\5.1\clibs\luasql\?.dll
Run mysql lua script in NEW cmd

Compiling MariaDB Connector v1.0.5 and/or Mysql Connection v 5.3.4

I am trying to compile MariaDB Connector v1.0.5 and/or Mysql Connection v 5.3.4.
I have MariaDB Server v.10.0.21 installed on a Slackware server. I just need to get a MYSQL connector working, doesn't matter which one.
Also applied the patch mentioned in Is there compatible ODBC driver with Mariadb 10 on Linux?
When I compile the MariaDB Connector I get an error saying "MariaDB not found".
When I compile the Mysql Connector I get the following error:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MYSQL_LIB
linked by target "myodbc5a" in directory /downloads/mysql-connector-odbc-5.3.4-src/driver
linked by target "myodbc5w" in directory /downloads/mysql-connector-odbc-5.3.4-src/driver
linked by target "myodbc5S" in directory /downloads/mysql-connector-odbc-5.3.4-src/setupgui
linked by target "myodbc-installer" in directory /downloads/mysql-connector-odbc-5.3.4-src/installer
OUTOUT from Error File
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec3523358880/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3523358880.dir/build.make CMakeFiles/cmTryCompileExec3523358880.dir/build
gmake1: Entering directory /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunct
ionExists.c
Linking C executable cmTryCompileExec3523358880
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3523358880.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o -o cmTryCompileExec3523358880 -rdynamic -lpth
reads
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../x86_64-slackware-linux/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec3523358880] Error 1
gmake[1]: Leaving directory/downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3523358880/fast] Error 2
Determining if the function dlopen exists failed with the following output:
Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec1888052970/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1888052970.dir/build.make CMakeFiles/cmTryCompileExec1888052970.dir/build
gmake1: Entering directory /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=dlopen -o CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunctionExist
s.c
Linking C executable cmTryCompileExec1888052970
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1888052970.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=dlopen CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o -o cmTryCompileExec1888052970 -rdynamic
CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o: In functionmain':
CheckFunctionExists.c:(.text+0x15): undefined reference to dlopen'
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec1888052970] Error 1
gmake[1]: Leaving directory/downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec1888052970/fast] Error 2
Blockquote
Just use the precompiled versions. Copy the libraries to the lib and include directories.

R library RMySQL doesn't start

I have installed R3.0.1. Rtools is also installed. MySQL version 5.7 is installed. I want to connect R to MySQL, and I am trying to do that through RMySQL package in R.
While the installation of RMySQL is finally done after looking at various SO questions, the library command gives error. Please see below complete R logs. Please help.
> install.packages("RMySQL",type="source")
trying URL 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
checking for $MYSQL_HOME... C:/Program Files/MySQL/MySQL Server 5.7
cygwin warning:
MS-DOS style path detected: C:/Program
Preferred POSIX equivalent is: /cygdrive/c/Program
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
test: Files/MySQL/MySQL: unknown operand
** libs
Warning: this package has a non-empty 'configure.win' file,
so building only the main architecture
cygwin warning:
MS-DOS style path detected: D:/SOFTWA~1/R-30~1.3/etc/x64/Makeconf
Preferred POSIX equivalent is: /cygdrive/d/SOFTWA~1/R-30~1.3/etc/x64/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc -m64 -I"D:/SOFTWA~1/R-30~1.3/include" -DNDEBUG -I"C:/Program Files/MySQL/MySQL Server 5.7"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall - std=gnu99 -mtune=core2 -c RS-DBI.c -o RS-DBI.o
RS-DBI.c: In function 'RS_na_set':
RS-DBI.c:1219:11: warning: variable 'c' set but not used [-Wunused-but-set-variable]
gcc -m64 -I"D:/SOFTWA~1/R-30~1.3/include" -DNDEBUG -I"C:/Program Files/MySQL/MySQL Server 5.7"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall - std=gnu99 -mtune=core2 -c RS-MySQL.c -o RS-MySQL.o
RS-MySQL.c: In function 'RS_MySQL_fetch':
RS-MySQL.c:657:13: warning: variable 'fld_nullOk' set but not used [-Wunused-but-set- variable]
RS-MySQL.c: In function 'RS_DBI_invokeBeginGroup':
RS-MySQL.c:1137:30: warning: variable 'val' set but not used [-Wunused-but-set-variable]
RS-MySQL.c: In function 'RS_DBI_invokeNewRecord':
RS-MySQL.c:1158:20: warning: variable 'val' set but not used [-Wunused-but-set-variable]
RS-MySQL.c: In function 'RS_MySQL_dbApply':
RS-MySQL.c:1219:38: warning: variable 'fld_nullOk' set but not used [-Wunused-but-set-variable]
gcc -m64 -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o C:/Program Files/MySQL/MySQL Server 5.7/bin/libmySQL.dll - Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LD:/SOFTWA~1/R-30~1.3/bin/x64 -lR
installing to D:/Softwares/R-3.0.3/library/RMySQL/libs/x64
** R
** inst
** preparing package for lazy loading
Creating a generic function for 'format' from package 'base' in package 'RMySQL'
Creating a generic function for 'print' from package 'base' in package 'RMySQL'
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
MYSQL_HOME defined as C:/Program Files/MySQL/MySQL Server 5.7
* DONE (RMySQL)
The downloaded source packages are in
‘C:\Users\mitrabhanu.panda\AppData\Local\Temp\RtmpgZHT8R\downloaded_packages’
> library(RMySQL)
Looking in C:\Program Files/MySQL, C:/MySQL, D:/MySQL, E:/MySQL, F:/MySQL, G:/MySQL, C:/xampp/MySQL, D:/xampp/MySQL, E:/xampp/MySQL, F:/xampp/MySQL, G:/xampp/MySQL, C:/Apps/MySQL, D:/Apps/MySQL, E:/Apps/MySQL, F:/Apps/MySQL, G:/Apps/MySQL
Found C:\Program Files/MySQL
Error : .onLoad failed in loadNamespace() for 'RMySQL', details:
call: setwd(bin)
error: character argument expected
Error: package or namespace load failed for ‘RMySQL’
Please let me know what I have done wrong.
As written in my comment, here is the sample code for reading a table from mysql:
require(RJDBC)
j <- JDBC(classPath='/path/to/mysql/jdbc/jar', driverClass='com.mysql.jdbc.Driver')
connection <- dbConnect(j, 'jdbc:mysql://localhost/databasename', 'myusername','mypassword')
on.exit(dbDisconnect(connection))
data.frame.from.sql <- dbReadTable(connection, 'tablename')
This will read the table named tablename from databasename into data.frame.from.sql as an R data frame that you can manipulate as you see fit. I hope this helps.

How do I fix "Symbol not found: _is_prefix" when compiling Perl's DBD::mysql?

First I wanted to build the DBD::mysql package. That kept failing because whatever make resulted in could not be loaded for the tests with a Symbol not found: _is_prefix. So I assumed that cpan might be a tad old. I know it's a random assumption, but cpan did tell me to install the latest Bundle::CPAN.
Who's successfully installed either DBD::mysql or Bundle::CPAN on Mac OS X 10.5? Could you recommend any thing I could be doing differently?
This is perl, v5.8.8 built for darwin-thread-multi-2level
(with 4 registered patches, see perl -V for more detail)
/usr/local/mysql/bin/mysql Ver 14.14 Distrib 5.1.36,
for apple-darwin9.5.0 (i386) using readline 5.1
Here's a log of the CPAN output for DBD::mysql:
Writing Makefile for DBD::mysql
cc -c -I/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch ppc -arch i386 -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3 -DVERSION=\"4.012\" -DXS_VERSION=\"4.012\" "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE" dbdimp.c
/usr/bin/perl -p -e "s/~DRIVER~/mysql/g" /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI/Driver.xst > mysql.xsi
Running Mkbootstrap for DBD::mysql ()
chmod 644 mysql.bs
/usr/bin/perl /System/Library/Perl/5.8.8/ExtUtils/xsubpp -typemap /System/Library/Perl/5.8.8/ExtUtils/typemap mysql.xs > mysql.xsc && mv mysql.xsc mysql.c
cp lib/DBD/mysql.pm blib/lib/DBD/mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib/lib/DBD/mysql/GetInfo.pm
cp lib/DBD/mysql/INSTALL.pod blib/lib/DBD/mysql/INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib/lib/Bundle/DBD/mysql.pm
cp mysql.bs blib/arch/auto/DBD/mysql/mysql.bs
chmod 644 blib/arch/auto/DBD/mysql/mysql.bs
Warning: duplicate function definition 'do' detected in mysql.xs, line 225
Warning: duplicate function definition 'rows' detected in mysql.xs, line 650
cc -c -I/Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBI -I/usr/local/mysql/include -DDBD_MYSQL_INSERT_ID_IS_GOOD -g -arch ppc -arch i386 -g -pipe -fno-common -DPERL_DARWIN -no-cpp-precomp -fno-strict-aliasing -Wdeclaration-after-statement -I/usr/local/include -O3 -DVERSION=\"4.012\" -DXS_VERSION=\"4.012\" "-I/System/Library/Perl/5.8.8/darwin-thread-multi-2level/CORE" mysql.c
dbdimp.c: In function 'mysql_describe':
dbdimp.c:3309: warning: assignment from incompatible pointer type
dbdimp.c: In function 'mysql_describe':
dbdimp.c:3309: warning: assignment from incompatible pointer type
rm -f blib/arch/auto/DBD/mysql/mysql.bundle
LD_RUN_PATH="/usr/local/mysql/lib" /usr/bin/perl myld cc -mmacosx-version-min=10.5.7 -arch ppc -arch i386 -bundle -undefined dynamic_lookup -L/usr/local/lib dbdimp.o mysql.o -o blib/arch/auto/DBD/mysql/mysql.bundle \
-L/usr/local/mysql/lib -lmysqlclient -lz -lm \
chmod 755 blib/arch/auto/DBD/mysql/mysql.bundle
Manifying blib/man3/DBD::mysql.3pm
Manifying blib/man3/DBD::mysql::INSTALL.3pm
Manifying blib/man3/Bundle::DBD::mysql.3pm
CAPTTOFU/DBD-mysql-4.012.tar.gz
/usr/bin/make -j3 -j3 -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.t .................. 1/6 Bailout called. Further testing stopped: Unable to load DBD::mysql
# Failed test 'use DBD::mysql;'
# at t/00base.t line 21.
# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/dlamblin/.cpan/build/DBD-mysql-4.012-4n3pv8/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/dlamblin/.cpan/build/DBD-mysql-4.012-4n3pv8/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Symbol not found: _is_prefix
# Referenced from: /Users/dlamblin/.cpan/build/DBD-mysql-4.012-4n3pv8/blib/arch/auto/DBD/mysql/mysql.bundle
# Expected in: dynamic lookup
# at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 255
CAPTTOFU/DBD-mysql-4.012.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports CAPTTOFU/DBD-mysql-4.012.tar.gz
Running make install
make test had returned bad status, won't install without force
Failed during this command:
CAPTTOFU/DBD-mysql-4.012.tar.gz : make_test NO
Okay, if you get these errors I now know the following:
MySQL 5.1 for Mac OS X x86_64 is not compatible with DBD::mysql (yet). Install the 32-bit x86 version, and try again. You'll succeed. I wish the perl Makefile.pl would just tell you that in a banner.
Bundle::CPAN had issues because I wasn't installing as root. Why that makes it report circular references instead of installation permission issues, I'll never understand.
Please add a comment if and when this became outdated information.
Installing the (beta) 5.4.1 64 bit version of mysql, available from their developer website, fixes the issue. Tested on Snow Leopard.
Did you try installing Bundle::DBD::mysql?
I haven't dealt with this problem, but I found that MacPorts cleaned up all my UNIX incompatibility problems. You might want to try that before enduring too much pain and suffering.
Where is it complaining about a circular dependency? It looks like you are trying to link to an incompatible version of the mysql libraries. The symbol it's looking for isn't in the library you loaded. I don't think this is a problem caused by CPAN.pm or the cpan script.
Some questions:
Who compiled perl? Is this Apple's perl?
Who compiled mysql? Is that your own version since it's in /usr/local?
Did you previously compile other versions? I start with a compile to ensure everything points to the right places.
Installing latest beta 64bit version of Mysql fixed problem on my computer.