Results 1 to 2 of 2
  1. #1
    Join Date
    May 2003
    Posts
    1

    Unanswered: DBD::DB2 compile failure using Cygwin/win2k

    I successfully installed the DBI module. However, I am attempting to install the DBD-DB2 perl module and am running into problems during the compile. I am doing a manual install of the DBD-DB2 module under cygwin.

    My OS is win2k
    My Perl version is 5.8.0.
    My DBI version 1.37
    My DBD-DB2 version is .76


    I get the following output when compiling DBD-DB2:

    gcc -c -I"/d/SQLLIB/include" -I/usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64in
    t/auto/DBI -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -DUSEIMPORTLIB -O2 -DVE
    RSION=\"0.76\" -DXS_VERSION=\"0.76\" "-I/usr/lib/perl5/5.8.0/cygwin-multi-64int
    /CORE" DB2.c
    In file included from DB2.h:9,
    from DB2.xs:7:
    /d/SQLLIB/include/sqlcli.h:311: warning: redefinition of `UCHAR'
    /usr/include/w32api/winnt.h:53: warning: `UCHAR' previously declared here
    /d/SQLLIB/include/sqlcli.h:312: warning: redefinition of `ULONG'
    /usr/include/w32api/winnt.h:55: warning: `ULONG' previously declared here
    /d/SQLLIB/include/sqlcli.h:313: warning: redefinition of `USHORT'
    /usr/include/w32api/winnt.h:54: warning: `USHORT' previously declared here
    gcc -c -I"/d/SQLLIB/include" -I/usr/lib/perl5/site_perl/5.8.0/cygwin-multi-64in
    t/auto/DBI -DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -DUSEIMPORTLIB -O2 -DVE
    RSION=\"0.76\" -DXS_VERSION=\"0.76\" "-I/usr/lib/perl5/5.8.0/cygwin-multi-64int
    /CORE" dbdimp.c
    In file included from DB2.h:9,
    from dbdimp.c:8:
    /d/SQLLIB/include/sqlcli.h:311: warning: redefinition of `UCHAR'
    /usr/include/w32api/winnt.h:53: warning: `UCHAR' previously declared here
    /d/SQLLIB/include/sqlcli.h:312: warning: redefinition of `ULONG'
    /usr/include/w32api/winnt.h:55: warning: `ULONG' previously declared here
    /d/SQLLIB/include/sqlcli.h:313: warning: redefinition of `USHORT'
    /usr/include/w32api/winnt.h:54: warning: `USHORT' previously declared here
    dbdimp.c: In function `dbd_db_connect':
    dbdimp.c:361: warning: cast to pointer from integer of different size
    dbdimp.c: In function `db2_db_STORE_attrib':
    dbdimp.c:837: warning: cast to pointer from integer of different size
    dbdimp.c: In function `db2_st_STORE_attrib':
    dbdimp.c:2266: warning: cast to pointer from integer of different size
    Running Mkbootstrap for DBD:B2 ()
    chmod 644 DB2.bs
    rm -f blib/arch/auto/DBD/DB2/DB2.dll
    LD_RUN_PATH="/usr/lib" ld2 -s -L/usr/local/lib DB2.o dbdimp.o -o blib/arch/au
    to/DBD/DB2/DB2.dll /usr/lib/perl5/5.8.0/cygwin-multi-64int/CORE/libperl.dll.a -
    L/d/SQLLIB/lib -ldb2
    gcc -shared -o DB2.dll -Wl,--out-implib=libDB2.dll.a -Wl,--export-all-symbols -
    Wl,--enable-auto-import -Wl,--stack,8388608 \
    -s -L/usr/local/lib DB2.o dbdimp.o /usr/lib/perl5/5.8.0/cygwin-multi-64int/CORE
    /libperl.dll.a -L/d/SQLLIB/lib -ldb2
    Creating library file: libDB2.dll.a
    dbdimp.o(.text+0x2f0):dbdimp.c: undefined reference to `_SQLGetDiagRec@32'
    dbdimp.o(.text+0x811):dbdimp.c: undefined reference to `_sqledosd_api@16'
    dbdimp.o(.text+0x896):dbdimp.c: undefined reference to `_sqledgne_api@12'
    dbdimp.o(.text+0x980):dbdimp.c: undefined reference to `_sqledcls_api@8'
    dbdimp.o(.text+0xa5c):dbdimp.c: undefined reference to `_SQLAllocHandle@12'
    dbdimp.o(.text+0xaad):dbdimp.c: undefined reference to `_SQLFreeHandle@8'
    dbdimp.o(.text+0xb0c):dbdimp.c: undefined reference to `_SQLFreeHandle@8'
    dbdimp.o(.text+0xb78):dbdimp.c: undefined reference to `_SQLConnect@28'
    dbdimp.o(.text+0xc15):dbdimp.c: undefined reference to `_SQLSetConnectAttr@16'
    dbdimp.o(.text+0xdc4):dbdimp.c: undefined reference to `_SQLAllocHandle@12'
    dbdimp.o(.text+0xe1f):dbdimp.c: undefined reference to `_SQLSetEnvAttr@16'
    dbdimp.o(.text+0xfad):dbdimp.c: undefined reference to `_SQLAllocHandle@12'
    dbdimp.o(.text+0xfed):dbdimp.c: undefined reference to `_SQLExecDirect@12'
    dbdimp.o(.text+0x102f):dbdimp.c: undefined reference to `_SQLRowCount@8'
    dbdimp.o(.text+0x106e):dbdimp.c: undefined reference to `_SQLFreeHandle@8'
    dbdimp.o(.text+0x128b):dbdimp.c: undefined reference to `_SQLAllocHandle@12'
    dbdimp.o(.text+0x144c):dbdimp.c: undefined reference to `_SQLFreeHandle@8'
    dbdimp.o(.text+0x147f):dbdimp.c: undefined reference to `_SQLSetStmtAttr@16'
    dbdimp.o(.text+0x14d1):dbdimp.c: undefined reference to `_SQLPrepare@12'
    dbdimp.o(.text+0x1579):dbdimp.c: undefined reference to `_SQLGetConnectAttr@20'
    dbdimp.o(.text+0x15bf):dbdimp.c: undefined reference to `_SQLTransact@12'
    dbdimp.o(.text+0x163f):dbdimp.c: undefined reference to `_SQLTransact@12'
    dbdimp.o(.text+0x1706):dbdimp.c: undefined reference to `_SQLDisconnect@4'
    dbdimp.o(.text+0x1792):dbdimp.c: undefined reference to `_SQLFreeHandle@8'
    dbdimp.o(.text+0x17e5):dbdimp.c: undefined reference to `_SQLFreeHandle@8'
    dbdimp.o(.text+0x1e0c):dbdimp.c: undefined reference to `_SQLSetConnectAttr@16'
    dbdimp.o(.text+0x21c6):dbdimp.c: undefined reference to `_SQLGetConnectAttr@20'
    dbdimp.o(.text+0x23be):dbdimp.c: undefined reference to `_SQLGetConnectAttr@20'
    dbdimp.o(.text+0x24e4):dbdimp.c: undefined reference to `_SQLNumResultCols@8'
    dbdimp.o(.text+0x2552):dbdimp.c: undefined reference to `_SQLFreeStmt@8'
    dbdimp.o(.text+0x2795):dbdimp.c: undefined reference to `_SQLDescribeCol@36'
    dbdimp.o(.text+0x283f):dbdimp.c: undefined reference to `_SQLColAttribute@28'
    dbdimp.o(.text+0x28ea):dbdimp.c: undefined reference to `_SQLBindCol@24'
    dbdimp.o(.text+0x2eb5):dbdimp.c: undefined reference to `_SQLAllocHandle@12'
    dbdimp.o(.text+0x308e):dbdimp.c: undefined reference to `_SQLTables@36'
    dbdimp.o(.text+0x32c6):dbdimp.c: undefined reference to `_SQLAllocHandle@12'
    dbdimp.o(.text+0x330f):dbdimp.c: undefined reference to `_SQLPrepare@12'
    dbdimp.o(.text+0x3361):dbdimp.c: undefined reference to `_SQLNumParams@8'
    dbdimp.o(.text+0x39ed):dbdimp.c: undefined reference to `_SQLBindParameter@40'
    dbdimp.o(.text+0x3b07):dbdimp.c: undefined reference to `_SQLBindFileToParam@32'

    dbdimp.o(.text+0x3dc7):dbdimp.c: undefined reference to `_SQLDescribeParam@24'
    dbdimp.o(.text+0x4390):dbdimp.c: undefined reference to `_SQLSetConnectOption@12
    '
    dbdimp.o(.text+0x452e):dbdimp.c: undefined reference to `_SQLExecute@4'
    dbdimp.o(.text+0x4595):dbdimp.c: undefined reference to `_SQLRowCount@8'
    dbdimp.o(.text+0x4a1d):dbdimp.c: undefined reference to `_SQLFetch@4'
    dbdimp.o(.text+0x4aa7):dbdimp.c: undefined reference to `_SQLMoreResults@4'
    dbdimp.o(.text+0x5106):dbdimp.c: undefined reference to `_SQLGetData@24'
    dbdimp.o(.text+0x5332):dbdimp.c: undefined reference to `_SQLFreeStmt@8'
    dbdimp.o(.text+0x5439):dbdimp.c: undefined reference to `_SQLFreeHandle@8'
    dbdimp.o(.text+0x59ef):dbdimp.c: undefined reference to `_SQLSetStmtAttr@16'
    dbdimp.o(.text+0x5df5):dbdimp.c: undefined reference to `_SQLGetStmtAttr@20'
    dbdimp.o(.text+0x6030):dbdimp.c: undefined reference to `_SQLGetStmtAttr@20'
    dbdimp.o(.text+0x6091):dbdimp.c: undefined reference to `_SQLMoreResults@4'
    dbdimp.o(.text+0x6966):dbdimp.c: undefined reference to `_SQLGetCursorName@16'
    collect2: ld returned 1 exit status
    perlld: *** system() failed to execute
    gcc -shared -o DB2.dll -Wl,--out-implib=libDB2.dll.a -Wl,--export-all-symbols -
    Wl,--enable-auto-import -Wl,--stack,8388608 \
    -s -L/usr/local/lib DB2.o dbdimp.o /usr/lib/perl5/5.8.0/cygwin-multi-64int/CORE
    /libperl.dll.a -L/d/SQLLIB/lib -ldb2

    make: *** [blib/arch/auto/DBD/DB2/DB2.dll] Error 1

    Any help would be greatly appreciated.

    Abe Jarrett

  2. #2
    Join Date
    Dec 2005
    Posts
    1

    Edit Makefile.PL

    Save this shell script as patchMakefile.sh in the same directory where DBD-DB2-0.78/Makefile.PL is and execute it:

    Code:
    #/bin/bash
    patch <<'PatchEOD'
    --- Makefile.PL 2004-09-14 10:50:31.000000000 -0400
    +++ Makefile.PL.SMS     2005-12-26 11:48:29.383557100 -0500
    @@ -95,6 +95,10 @@
         }
       }
     }
    +elsif( $os =~ /cygwin/i) {
    +  $opts{OBJECT}    .= qq{ \\"${DB2}/lib/db2api.lib\\" \\"${DB2}/lib/db2cli.lib\\" };
    +  $opts{LDDLFLAGS}  = $Config{lddlflags} . ' -Wl,--exclude-libs,ALL';
    +}
     else
     {
       $sysliblist = "-L$DB2/lib -ldb2";
    PatchEOD
    Last edited by vtkstef; 01-06-06 at 00:44.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •