Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Installation of DBD::Sybase with Strawberry Perl

by Anonymous Monk
on Mar 08, 2021 at 09:38 UTC ( [id://11129322]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm running Strawberry Perl 5.32.0 on an Windows 10 machine and trying to install the DBD::Sybase module. Sybase ASE 16 libraries and headers are installed and working fine with other projects.

I receive the following error messages from cpan:

Warning (mostly harmless): No library found for -llibct.lib Warning (mostly harmless): No library found for -llibcs.lib ...

Since about Sybase 16 the libraries are named libsybct.lib, libsybcs.lib, ...

I also receive a lot of linking error messages from cpan like:

dbdimp.o:dbdimp.c:(.text+0x10b4): undefined reference to `ct_config'
Therefore, the warnings above are most likely not harmless at all.

I had the same problems installing DBD::Sybase on an older Windows 7 machine 2 years ago after upgrading Sybase to version 16, but no problems with earlier Sybase versions.

Makefile.PL fails detecting the Sybase version in getLibVersion and tries the wrong libraries therefore. I changed the content of getLibVersion to return 16;, which is the correct version. After perl Makefile.PL and gmake I get Makefile:992: *** target file 'Makefile' has both : and :: entries. Stop. At line 992 there is $(FIRST_MAKEFILE) : Makefile.PL $(CONFIGDEP).

How can I solve this problem?

Replies are listed 'Best First'.
Re: Installation of DBD::Sybase with Strawberry Perl
by syphilis (Archbishop) on Mar 08, 2021 at 13:48 UTC
    Are you saying that line 992 of the generated Makefile contains the string "Makefile.PL" ?
    That would seem very strange to me.
    Did it contain the same string before you altered getLibVersion ?

    Could you provide (placed inside <code> and </code> tags) a copy'n'paste of lines 988 to 996 (or thereabouts) ?

    Cheers,
    Rob
      I'm sorry. I got the problems described above in 01/2021, asked the same question at Stackoverflow but got no useful response. So I decided to ask here at perlmonks - without reproducing the problems again bevor posting. There is a new DBD::Sybase version available at CPAN which seems to address a few of the problems. The Sybase version is now detected correctly and there are no longer errors in the generated makefile. It still won't work anyway. I get
      Warning (mostly harmless): No library found for -llibsybct.lib Warning (mostly harmless): No library found for -llibsybcs.lib Warning (mostly harmless): No library found for -llibsybtcl.lib Warning (mostly harmless): No library found for -llibsybcomn.lib Warning (mostly harmless): No library found for -llibsybintl.lib Warning (mostly harmless): No library found for -llibsybblk.lib
      from Makefile.PL. After running cmake I get these errors:
      "C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"DBD::Sybase\", 'DLBASE' => 'Sybase', 'DL +_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => [] +);" g++ Sybase.def -o blib\arch\auto\DBD\Sybase\Sybase.xs.dll -mdll -s -L" +C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" Sybase.o dbdimp.o +"C:\STRAWB~1\perl\lib\CORE\libperl532.a" "C:\STRAWB~1\c\x86_64-w64-mi +ngw32\lib\libm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmoldname.a +" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libkernel32.a" "C:\STRAWB~1\c +\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRAWB~1\c\x86_64-w64-mingw3 +2\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinspool.a +" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomdlg32.a" "C:\STRAWB~1\c +\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\STRAWB~1\c\x86_64-w64-ming +w32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libole32. +a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\liboleaut32.a" "C:\STRAWB~1\ +c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\STRAWB~1\c\x86_64-w64-min +gw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libws2_32.a +" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmpr.a" "C:\STRAWB~1\c\x86_ +64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\ +libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbc32.a" "C:\ +STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32.a" "C:\STRAWB~1\c\x86_6 +4-w64-mingw32\lib\libcomctl32.a" -Wl,--enable-auto-image-base C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x8 +6_64-w64-mingw32/bin/ld.exe: dbdimp.o:dbdimp.c:(.text+0xd51): undefin +ed reference to `ct_options' C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x8 +6_64-w64-mingw32/bin/ld.exe: dbdimp.o:dbdimp.c:(.text+0xe15): undefin +ed reference to `ct_cmd_alloc' C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x8 +6_64-w64-mingw32/bin/ld.exe: dbdimp.o:dbdimp.c:(.text+0xef4): undefin +ed reference to `ct_config' C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x8 +6_64-w64-mingw32/bin/ld.exe: dbdimp.o:dbdimp.c:(.text+0xf34): undefin +ed reference to `ct_config' C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x8 +6_64-w64-mingw32/bin/ld.exe: dbdimp.o:dbdimp.c:(.text+0xfae): undefin +ed reference to `ct_con_alloc' C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x8 +6_64-w64-mingw32/bin/ld.exe: dbdimp.o:dbdimp.c:(.text+0xff1): undefin +ed reference to `ct_con_props' ... (many more) ...
      The linking process seems to ignore the library directory of the Sybase installation. The library paths are set in Makefile.PL with my $lddlflags = $Config{lddlflags};. I don't know where to configure this and added the Sybase library directory manually to $lddlflags.
      $lddlflags .= '-L"c:\SAP\OCS-16_0\dll\"';
      Now I get
      "C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"DBD::Sybase\", 'DLBASE' => 'Sybase', 'DL +_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_VARS' => [] +);" g++ Sybase.def -o blib\arch\auto\DBD\Sybase\Sybase.xs.dll -mdll -s -L" +C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"-L"c:\SAP\OCS-16_0\dl +l\" Sybase.o dbdimp.o "C:\STRAWB~1\perl\lib\CORE\libperl532.a" "C:\ +STRAWB~1\c\x86_64-w64-mingw32\lib\libm.a" "C:\STRAWB~1\c\x86_64-w64-m +ingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libke +rnel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser32.a" "C:\STRA +WB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c\x86_64-w64-m +ingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libco +mdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvapi32.a" "C:\ST +RAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB~1\c\x86_64-w +64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libo +leaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libnetapi32.a" "C:\S +TRAWB~1\c\x86_64-w64-mingw32\lib\libuuid.a" "C:\STRAWB~1\c\x86_64-w64 +-mingw32\lib\libws2_32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libmp +r.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libwinmm.a" "C:\STRAWB~1\c +\x86_64-w64-mingw32\lib\libversion.a" "C:\STRAWB~1\c\x86_64-w64-mingw +32\lib\libodbc32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libodbccp32 +.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libcomctl32.a" -Wl,--enable +-auto-image-base C:/Strawberry/c/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x8 +6_64-w64-mingw32/bin/ld.exe: cannot export boot_DBD__Sybase: symbol n +ot defined collect2.exe: error: ld returned 1 exit status gmake: *** [Makefile:490: blib\arch\auto\DBD\Sybase\Sybase.xs.dll] Err +or 1

        Whatever you did, it messed up the command line that g++ is invoked with:

        g++ Sybase.def -o blib\arch\auto\DBD\Sybase\Sybase.xs.dll -mdll -s -L" +C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib"-L"c:\SAP\OCS-16_0\dl +l\" Sybase.o ...

        Note how these escaped bckslashes and missing spaces in your addition are unlike the other -L stanzas.

        A first step would be to make these identical to the other -L stanzas and add proper whitespace:

        g++ Sybase.def -o blib\arch\auto\DBD\Sybase\Sybase.xs.dll -mdll -s -L" +C:\STRAWB~1\perl\lib\CORE" -L"C:\STRAWB~1\c\lib" -L "c:\SAP\OCS-16_0\ +dll" Sybase.o

        Also, there should be a way to pass the proper parameters to Makefile.PL from the command line instead of patching Makefile.PL.

        Warning (mostly harmless): No library found for -llibsybct.lib Warning (mostly harmless): No library found for -llibsybcs.lib Warning (mostly harmless): No library found for -llibsybtcl.lib Warning (mostly harmless): No library found for -llibsybcomn.lib Warning (mostly harmless): No library found for -llibsybintl.lib Warning (mostly harmless): No library found for -llibsybblk.lib
        I think you'll need to get rid of those warnings - though it's hard to be sure as I'm missing a lot of information.
        Do those library files (libsybct.lib, etc.) actually exist ?
        If they do, then inside the Makefile.PL remove the 'lib' and '.lib' from the names, so that -llibsybct.lib becomes -lsybct
        Do the same thing for the other 5 libs, then start again and see if that works.

        If files of those names do not exist, then what names do they actually have ?

        Another reason that the libraries are not being found could simply be that the system doesn't know where they are.
        This can be fixed by running set LIBRARY_PATH=%LIBRARY_PATH%;C:\location\of\libs where "C:\location\of\libs" is replaced with the actual path to the location of those libs.

        Whenever you make any changes, you should then start the build process all over again from the beginning

        Cheers,
        Rob
        (I wrote "cmake" once, but it's "gmake").

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11129322]
Front-paged by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-26 06:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found