in reply to Re^2: Installation of DBD::Sybase with Strawberry Perl
in thread Installation of DBD::Sybase with Strawberry Perl

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

Replies are listed 'Best First'.
Re^4: Installation of DBD::Sybase with Strawberry Perl
by Anonymous Monk on Mar 09, 2021 at 11:33 UTC
    Most of these libraries exist (and the few others are most likely not important indeed). I changed Makefile.PL to -lsybct (..), but got the same result. I set the LIBRARY_PATH then, which reduced the warnings I got from Makefile.PL to
    Warning (mostly harmless): No library found for -lsybtcl Warning (mostly harmless): No library found for -lsybcomn Warning (mostly harmless): No library found for -lsybintl
    This is much better, because these libraries are not installed by the Sybase driver, but gmake still results in
    c:\Strawberry\cpan\build\DBD-Sybase-1.17-0>gmake Skip blib\lib\DBD\dbd-sybase.pod (unchanged) Skip blib\lib\DBD\Sybase.pm (unchanged) Running Mkbootstrap for Sybase () "C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command -e chmod -- 644 +"Sybase.bs" "C:\Strawberry\perl\bin\perl.exe" -MExtUtils::Command::MM -e cp_nonemp +ty -- Sybase.bs blib\arch\auto\DBD\Sybase\Sybase.bs 644 gcc -c -IC:\SAP/OCS-16_0/include -DNO_BLK=1 -IC:/Strawberry/perl/vend +or/lib/auto/DBI -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTM +ODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO +-fwrapv -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"1.17 +\" -DXS_VERSION=\"1.17\" "-IC:\STRAWB~1\perl\lib\CORE" Sybase.c In file included from C:\STRAWB~1\perl\lib\CORE/perl.h:5603, from C:/Strawberry/perl/vendor/lib/auto/DBI/DBIXS.h:2 +3, from Sybase.h:16, from Sybase.xs:14: Sybase.xs: In function 'XS_DBD__Sybase__db_ping': Sybase.xs:84:32: warning: implicit declaration of function 'syb_ping'; + did you mean 'syb_init'? [-Wimplicit-function-declaration] ST(0) = sv_2mortal(newSViv(syb_ping(dbh, imp_dbh))); ^~~~~~~~ C:\STRAWB~1\perl\lib\CORE/embed.h:557:46: note: in definition of macro + 'sv_2mortal' #define sv_2mortal(a) Perl_sv_2mortal(aTHX_ a) ^ Sybase.xs:84:24: note: in expansion of macro 'newSViv' ST(0) = sv_2mortal(newSViv(syb_ping(dbh, imp_dbh))); ^~~~~~~ Sybase.xs: In function 'XS_DBD__Sybase__st_cancel': Sybase.xs:96:13: warning: implicit declaration of function 'syb_st_can +cel'; did you mean 'syb_st_finish'? [-Wimplicit-function-declaration] ST(0) = syb_st_cancel(sth, imp_sth) ? &PL_sv_yes : &PL_sv_no; ^~~~~~~~~~~~~ syb_st_finish gcc -c -IC:\SAP/OCS-16_0/include -DNO_BLK=1 -IC:/Strawberry/perl/vend +or/lib/auto/DBI -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTM +ODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO +-fwrapv -fno-strict-aliasing -mms-bitfields -s -O2 -DVERSION=\"1.17 +\" -DXS_VERSION=\"1.17\" "-IC:\STRAWB~1\perl\lib\CORE" dbdimp.c dbdimp.c: In function 'syb_st_execute': dbdimp.c:4076:39: warning: passing argument 2 of 'ct_results' from inc +ompatible pointer type [-Wincompatible-pointer-types] while (ct_results(imp_sth->cmd, &restype) == CS_SUCCEED && rest +ype != CS_CMD_DONE) { ^~~~~~~~ In file included from Sybase.h:19, from dbdimp.c:10: C:\SAP/OCS-16_0/include/ctpublic.h:381:10: note: expected 'CS_INT *' { +aka 'long int *'} but argument is of type 'int *' CS_INT *result_type ~~~~~~~~^~~~~~~~~~~ dbdimp.c:4101:75: warning: passing argument 5 of 'ct_bind' from incomp +atible pointer type [-Wincompatible-pointer-types] if( ct_bind(imp_sth->cmd, i+1, &phs->datafmt, SvPVX(phs-> +sv), &params[i].len, 0) != CS_SUCCEED ) + ^~~~~~~~~~~~~~ In file included from Sybase.h:19, from dbdimp.c:10: C:\SAP/OCS-16_0/include/ctpublic.h:117:10: note: expected 'CS_INT *' { +aka 'long int *'} but argument is of type 'int *' CS_INT *outputlen, ~~~~~~~~^~~~~~~~~ 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:\SAP\OCS-16_0\lib\libsybc +t.lib" "c:\SAP\OCS-16_0\lib\libsybcs.lib" "c:\SAP\OCS-16_0\lib\libsyb +blk.lib" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libm.a" "C:\STRAWB~1\c +\x86_64-w64-mingw32\lib\libmoldname.a" "C:\STRAWB~1\c\x86_64-w64-ming +w32\lib\libkernel32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libuser3 +2.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libgdi32.a" "C:\STRAWB~1\c +\x86_64-w64-mingw32\lib\libwinspool.a" "C:\STRAWB~1\c\x86_64-w64-ming +w32\lib\libcomdlg32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libadvap +i32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libshell32.a" "C:\STRAWB +~1\c\x86_64-w64-mingw32\lib\libole32.a" "C:\STRAWB~1\c\x86_64-w64-min +gw32\lib\liboleaut32.a" "C:\STRAWB~1\c\x86_64-w64-mingw32\lib\libneta +pi32.a" "C:\STRAWB~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-ming +w32\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\li +b\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: 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' 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+0x1028): undefi +ned reference to `ct_con_props' 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+0x10be): undefi +ned reference to `ct_con_props' 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+0x114a): undefi +ned reference to `ct_con_props' 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+0x1188): undefi +ned reference to `ct_con_props' 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+0x11d4): more u +ndefined references to `ct_con_props' follow 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+0x12c3): undefi +ned reference to `cs_loc_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+0x130c): undefi +ned reference to `cs_locale' 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+0x136f): undefi +ned reference to `cs_locale' 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+0x13d2): undefi +ned reference to `cs_locale' 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+0x1427): undefi +ned reference to `cs_dt_info' 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+0x14a9): undefi +ned reference to `ct_config' ... (und many more lines) ...
    All these ct_.. functions are located in libsybct.lib, the cs_.. functions are located in libsybcs.lib.
      <UPDATE> I missed that you had effectively covered most of what I originally wrote in this post.
      If libsybct.lib and libsybcs.lib are in the path specified in LIBRARY_PATH then the reason they're not being linked in is that the name specified in the "-l..." switch is incorrect.
      If "-lsybct" is not working, try variations like "-llibsybct.lib", "-llibsybct", "-lsybct.lib" ... until you hit the rendition that works.

      If libsybct.lib and libsybcs.lib are not in the path specified in LIBRARY_PATH, then add that location to LIBRARY_PATH:
      set LIBRARY_PATH=%LIBRARY_PATH%;C:\path\to\libs;C:\path\to_other\libs
      AFAICS, the only issue is that there's still one or two libs that aren't being linked in.
      Perhaps there's another location that needs to be added to LIBRARY_PATH, or perhaps the wrong filename is being specified.

      You can identify those libraries by doing a plain text search of all lib files for the undefined references.
      It's a bit of a rough hack, but it has always worked fine for me. Once you've found the lib file that contains the string "ct_options", then you've probably found the lib file that will resolve that symbol.
      Similarly, for "ct_cmd_alloc", "ct_config", etc.
      My guess would be that there's one lib that resolves the undefined "ct_*" symbols and another that resolves the undefined "cs_*" symbols.
      Once you've established the name(s) and location(s) of the relevant lib(s), then you should hopefully have all the info needed for you to fix the problem.


      Cheers,
      Rob

        Rob, it's a static link: c:\SAP\OCS-16_0\lib\libsybct.lib

      In order to make sure that the library does contain function references use nm -a or some windows equivalent.

      But why does the Makefile runs the compiler with these 2 flags: -DWIN32 -DWIN64. They seem contradictory to me? If you are linking 32 bit libraries with 64 bit perl you are most likely have problems.

      bw, bliako

        But why does the Makefile runs the compiler with these 2 flags: -DWIN32 -DWIN64

        They're actually part of perl's ccflags:
        C:\perl -V:ccflags ccflags=' -DWIN32 -DWIN64 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCR +IPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv + -fno-strict-aliasing -mms-bitfields';

        WIN32 is a symbol that's defined on all Windows systems (both 32-bit and 64-bit). I don't think there's any need to specify it.
        Defining WIN64 specifies that you want to operate in 64-bit mode, and that the compiler is 64-bit..

        Cheers,
        Rob
Re^4: Installation of DBD::Sybase with Strawberry Perl
by Anonymous Monk on Mar 10, 2021 at 09:11 UTC
    libsybct.lib and libsybcs.lib are in the path specified in LIBRARY_PATH and I tried every variation of "-llibsybct.lib", "-llibsybct", "-lsybct.lib", .. None worked :(
      .. None worked :(

      I wonder why nothing worked.
      I take it that libsybct.lib and libsybcs.lib are in the same directory as libsybtcl.lib, libsybintl.lib and libsybblk.lib.
      It seems very odd that some are being located, but others are not.

      Try creating copies of libsybct.lib and libsybcs.lib (in the same folder as those two files ), named libsybct.a and libsybcs.a.
      Then specify the '-l' switches as -lsybct and -lsybcs
      And see what happens then.

      Cheers,
      Rob