REPOST: Unable to compile DBD::mysql-3.0002 on Win32

Will Hawes <[email protected]>
Newsgroups gmane.comp.db.mysql.perl
Message-ID <[email protected]>
Reposted - the original appears not to have made it to the list.

-------- Original Message --------
Subject: Unable to compile DBD::mysql-3.0002 on Win32
Date: Sat, 24 Dec 2005 09:36:13 +0000
From: Will Hawes <[email protected]>
To: [email protected]

I'm using Windows XP SP2 with Perl 5.8.7, MySQL 5.0.16, dmake and MinGW.
I have DBI 1.48 installed (and have also tried 1.50 with the same
result). DBD-mysql-3.0002 refuses to compile as follows:

C:\Perl\DBD-mysql-3.0002>perl Makefile.PL "--libs=-LC:/mysql/5.0/lib/opt
-lmysql
client" --cflags="-IC:/mysql/5.0/include
-IC:/Perl/site/5.8.7/lib/auto/DBI" --testuser=myuser
--testpassword=mypassword
I will use the following settings for compiling and testing:

   cflags        (User's choice) = -IC:/mysql/5.0/include
-IC:/Perl/site/5.8.7/li
b/auto/DBI
   embedded      (guessed      ) =
   libs          (User's choice) = -LC:/mysql/5.0/lib/opt -lmysqlclient
   nocatchstderr (default      ) = 0
   nofoundrows   (default      ) = 0
   ssl           (guessed      ) = 0
   testdb        (default      ) = test
   testhost      (default      ) =
   testpassword  (default      ) = mypassword
   testsocket    (default      ) =
   testuser      (default      ) = myuser

To change these settings, see 'perl Makefile.PL --help' and
'perldoc INSTALL'.

Note (probably harmless): No library found for -lmysqlclient
Using DBI 1.48 (for perl 5.008007 on MSWin32-x86-multi-thread) installed
in c:/P
erl/site/5.8.7/lib/auto/DBI/
Writing Makefile for DBD::mysql

C:\Perl\DBD-mysql-3.0002>dmake
gcc -c  -Ic:/Perl/site/5.8.7/lib/auto/DBI/ -IC:/mysql/5.0/include
-IC:/Perl/site
/5.8.7/lib/auto/DBI -DDBD_MYSQL_INSERT_ID_IS_GOOD -g    -s -O2 -DWIN32
-DHAVE_DE
S_FCRYPT -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS
-fno-strict-aliasing -DPERL
_MSVCRT_READFIX -s -O2    -DVERSION=\"3.0002\"  -DXS_VERSION=\"3.0002\"
  "-IC:\p
erl\5.8.7\lib\CORE"   mysql.c
Running Mkbootstrap for DBD::mysql ()
C:\Perl\5.8.7\bin\perl.exe -MExtUtils::Command -e chmod 644 mysql.bs
dlltool --def mysql.def --output-exp dll.exp
C:\Perl\5.8.7\bin\perl.exe myld g++ -o
blib\arch\auto\DBD\mysql\mysql.dll -Wl,--
base-file -Wl,dll.base -mdll -s -L"c:\perl\5.8.7\lib\CORE"
-L"C:\MinGW\lib" dbdi
mp.o    mysql.o -Wl,--image-base,0x1570000
C:\perl\5.8.7\lib\CORE\libperl58.a C
:\MinGW\lib\libmsvcrt.a C:\MinGW\lib\libmoldname.a
C:\MinGW\lib\libkernel32.a C:
\MinGW\lib\libuser32.a C:\MinGW\lib\libgdi32.a
C:\MinGW\lib\libwinspool.a C:\Min
GW\lib\libcomdlg32.a C:\MinGW\lib\libadvapi32.a
C:\MinGW\lib\libshell32.a C:\Min
GW\lib\libole32.a C:\MinGW\lib\liboleaut32.a C:\MinGW\lib\libnetapi32.a
C:\MinGW
\lib\libuuid.a C:\MinGW\lib\libws2_32.a C:\MinGW\lib\libmpr.a
C:\MinGW\lib\libwi
nmm.a C:\MinGW\lib\libversion.a C:\MinGW\lib\libodbc32.a dll.exp
dbdimp.o(.text+0x6ff): In function `mysql_dr_connect':
C:/Perl/DBD-mysql-3.0002/dbdimp.c:1275: undefined reference to
`mysql_init@4'
dbdimp.o(.text+0x79c):C:/Perl/DBD-mysql-3.0002/dbdimp.c:1427: undefined
referenc
e to `mysql_real_connect@32'
dbdimp.o(.text+0x9b6):C:/Perl/DBD-mysql-3.0002/dbdimp.c:1295: undefined
referenc
e to `mysql_options@12'
dbdimp.o(.text+0xa78):C:/Perl/DBD-mysql-3.0002/dbdimp.c:1305: undefined
referenc
e to `mysql_options@12'
dbdimp.o(.text+0xb3e):C:/Perl/DBD-mysql-3.0002/dbdimp.c:1316: undefined
referenc
e to `mysql_options@12'
dbdimp.o(.text+0xc0e):C:/Perl/DBD-mysql-3.0002/dbdimp.c:1327: undefined
referenc
e to `mysql_options@12'
dbdimp.o(.text+0xe9c):C:/Perl/DBD-mysql-3.0002/dbdimp.c:1419: undefined
referenc
e to `mysql_options@12'
dbdimp.o(.text+0x175f): In function `mysql_db_login':
C:/Perl/DBD-mysql-3.0002/dbdimp.c:1572: undefined reference to
`mysql_error@4'
...

The error messages continue in a similar fashion for quite a while longer.

Googling seems to indicate that this is because the linker cannot find
the libraries it needs - but I've build the command line for "perl
Makefile.PL" in accordance with the DBD::mysql docs and "--libs"
contains the correct path to the directory containing mysqlclient.lib.

MySQL was installed using "Full Installation" with a precompiled binary.
C:\mysql\5.0\lib\opt contains the following:

libmysql.dll
libmysql.lib
mysqlclient.lib
mysys.lib
mysys_tls.lib
mysys-max.lib
regex.lib
strings.lib
zlib.lib

"mysql -V" gives the following:

mysql  Ver 14.12 Distrib 5.0.16, for Win32 (ia32)

"perl -V" gives the following:

Summary of my perl5 (revision 5 version 8 subversion 7) configuration:
   Platform:
     osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
     uname=''
     config_args='undef'
     hint=recommended, useposix=true, d_sigaction=undef
     usethreads=define use5005threads=undef useithreads=define
usemultiplicity=de
fine
     useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
     use64bitint=undef use64bitall=undef uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='gcc', ccflags ='-s -O2 -DWIN32 -DHAVE_DES_FCRYPT
-DPERL_IMPLICIT_CONTEXT
  -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVCRT_READFIX',
     optimize='-s -O2',
     cppflags='-DWIN32'
     ccversion='', gccversion='3.4.2', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long
long', lseek
size=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='g++', ldflags ='-s -L"c:\perl\5.8.7\lib\CORE" -L"C:\MinGW\lib"'
     libpth=C:\MinGW\lib
     libs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool
-lcomdlg32
-ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32 -lmpr
-lwinmm
  -lversion -lodbc32
     perllibs= -lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32
-lwinspool -lcomdl
g32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid -lws2_32
-lmpr -lw
inmm -lversion -lodbc32
     libc=-lmsvcrt, so=dll, useshrplib=yes, libperl=libperl58.a
     gnulibc_version='undef'
   Dynamic Linking:
     dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
     cccdlflags=' ', lddlflags='-mdll -s -L"c:\perl\5.8.7\lib\CORE"
-L"C:\MinGW\l
ib"'


Characteristics of this binary (from libperl):
   Compile-time options: MULTIPLICITY USE_ITHREADS USE_LARGE_FILES
                         PERL_IMPLICIT_CONTEXT PERL_IMPLICIT_SYS
   Built under MSWin32
   Compiled at Dec 22 2005 12:17:48
   @INC:
     c:/Perl/5.8.7/lib
     c:/Perl/site/5.8.7/lib
     .

Any guidance would be appreciated.



-- 
MySQL Perl Mailing List
For list archives: http://lists.mysql.com/perl
To unsubscribe:    http://lists.mysql.com/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.