in reply to Re: How to build DBD::MySQL
in thread How to build DBD::MySQL

Thanks for your help.
Here were my procedure:

cd c:\mysql\lib\opt
reimp libmysql.lib
rename LIBMYSQL.def libmysql.def
dlltool --input-def libmysql.def --dllname libmysql.dll --output-lib mysql.a rename liblibmysql.a libmysql.a
I added this parameter to the perl makefile.pl
-LC:\Programs\mysql-4.1.12-win32\lib\opt
-lmysql
Nevertheless I still get the following error:
D:\TMP\DBD-mysql-4.007>dmake gcc -c -IC:\perl\site\lib\auto\DBI -IC:\mysql\include -DDBD_MYSQL_INS +ERT_ID_IS_GOOD -g -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL _IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVC +RT_READFIX -s -O2 -DVERSION=\"4.007\" -DXS_VERSION=\" 4.007\" "-IC:\perl\lib\CORE" dbdimp.c gcc -c -IC:\perl\site\lib\auto\DBI -IC:\mysql\include -DDBD_MYSQL_INS +ERT_ID_IS_GOOD -g -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DPERL _IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPERL_MSVC +RT_READFIX -s -O2 -DVERSION=\"4.007\" -DXS_VERSION=\" 4.007\" "-IC:\perl\lib\CORE" mysql.c Running Mkbootstrap for DBD::mysql () C:\perl\bin\perl.exe -MExtUtils::Command -e chmod 644 mysql.bs dlltool --def mysql.def --output-exp dll.exp C:\perl\bin\perl.exe myld g++ -o blib\arch\auto\DBD\mysql\mysql.dll -W +l,--base-file -Wl,dll.base -mdll -s -L"c:\perl\lib\CORE" -L"C:\Mi nGW\lib" dbdimp.o mysql.o -Wl,--image-base,0x1570000 C:\perl\li +b\CORE\libperl58.a C:\MinGW\lib\libmysql.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: \MinGW\lib\libcomdlg32.a C:\MinGW\lib\libadvapi32.a C:\MinGW\lib\libsh +ell32.a C:\MinGW\lib\libole32.a C:\MinGW\lib\liboleaut32.a C:\Min GW\lib\libnetapi32.a C:\MinGW\lib\libuuid.a C:\MinGW\lib\libws2_32.a C +:\MinGW\lib\libmpr.a C:\MinGW\lib\libwinmm.a C:\MinGW\lib\libvers ion.a C:\MinGW\lib\libodbc32.a C:\MinGW\lib\libodbccp32.a dll.exp dbdimp.o: In function `dbd_discon_all': D:/TMP/DBD-mysql-4.007/dbdimp.c:1972: undefined reference to `mysql_se +rver_end@0' collect2: ld returned 1 exit status dmake: Error code 129, while making 'blib\arch\auto\DBD\mysql\mysql.d +ll'

Replies are listed 'Best First'.
Re^3: How to build DBD::MySQL
by almut (Canon) on Jul 15, 2008 at 11:30 UTC

    I'm no expert in the specifics of the DBD::mysql build process, but this line in the make messages

    dlltool --def mysql.def --output-exp dll.exp

    looks as if it's trying to create a dll.exp itself (from a mysql.def), which is then being referenced in the subsequent compile/link step.  In other words, I would not try to create a libmysql.a myself, but rather just rename the output of "reimp libmysql.lib" to mysql.def, and leave the rest to the build process as is...  Just an idea, though. Hope it helps.

    (Be sure to also check whether the .def file does in fact contain the symbols that are being reported as "undefined"...)

      I just tried, but I still get the same error.