PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: Michael Peppler <mpeppler at peppler dot org>
Subject: RE: Problems installing Sybperl module on Windows NT ...
Date: Nov 6 2002 4:15PM

I don't really know much about Windows - but try putting the BEGIN {}
block before the use Sybase::CTlib and see if that helps.

Another possible problem might be that the Sybase libraries aren't found
when the CTlib.dll is loaded. I don't know how to tell Windows where to
look for those libraries.

Michael


On Wed, 2002-11-06 at 06:43, Omidiran, Ola wrote:
> I did manage to get these packages installed afterall. However, I am now
> faced with the following errors when I run a Perl script that uses the CTlib
> module:
> 
> C:\OLA_DB~1\PERLST~1>perl -d ola_sybperl_exampl.pl
> Can't load 'C:\Perl\site\lib/auto/Sybase/CTlib/CTlib.dll' for module
> Sybase::CTlib: load_file:The specified module could not
> be found at C:\Perl\lib/DynaLoader.pm line 206.
> Compilation failed in require at ola_sybperl_exampl.pl line 5.
> BEGIN failed--compilation aborted at ola_sybperl_exampl.pl line 5.
> 
> B/4 you say ah ha, my PPM output shows I have all the required packages
> installed:
> 
> PPM> query
> DBD-CSV          [0.1023 ] DBI driver for CSV files
> DBD-ODBC         [0.28   ] ODBC driver for the DBI module.
> DBD-Sybase       [0.22   ]
> sybperl          [2.11   ] Sybase extensions to Perl
> <<<<<<<===========================================
> PPM>
> 
> Extracts from the script I am trying to run is as follows:
> 
> #!c:\Perl\bin\perl
> 
> use strict;
> 
> use Sybase::CTlib;    <<<<<<<<<<<<<<<<<<=================not getting past
> here !!!
> 
> BEGIN {
> 	$ENV{SYBASE} = 'c:\SYBASE1192';
> }
> 
> ct_callback(CS_CLIENTMSG_CB, \&msg_cb);
> ct_callback(CS_SERVERMSG_CB, "srv_cb");
> $uid = 'sybadmin'; $pwd = 'pegasus'; $srv = 'CSO_SYB_KINBANE';
> 
> $X=new Sybase::CTlib 'user', 'pwd', 'srv';  
> $X = Sybase::CTlib->ct_connect($uid, $pwd, $srv);
> 
> $X->ct_execute("select name from master..sysdatabases");
> 
>    while(($rc = $X->ct_results($restype)) == CS_SUCCEED) {
>         next if($restype == CS_CMD_DONE || $restype == CS_CMD_FAIL ||
>                 $restype == CS_CMD_SUCCEED);
>         if(@names = $X->ct_col_names()) {
>              print "@names\n";
>         }
>         if(@types = $X->ct_col_types()) {
>              print "@types\n";
>         }
>         while(@dat = $X->ct_fetch) {
>              print "@dat\n";
>         }
>     }
>     print "End of Result Set\n" if($rc == CS_END_RESULTS);
>     print "Error!\n" if($rc == CS_FAIL);
> 	sub msg_cb {
>         my($layer, $origin, $severity, $number, $msg, $osmsg, $dbh) = @_;
> 	printf STDERR "\nOpen Client Message: (In msg_cb)\n";
>         printf STDERR "Message number: LAYER = (%ld) ORIGIN = (%ld) ",
>                $layer, $origin;
>         printf STDERR "SEVERITY = (%ld) NUMBER = (%ld)\n",
>                $severity, $number;
>         printf STDERR "Message String: %s\n", $msg;
>         if (defined($osmsg)) {
>             printf STDERR "Operating System Error: %s\n", $osmsg;
>         }
>         CS_SUCCEED;
>     }
>     sub srv_cb {
>         my($dbh, $number, $severity, $state, $line, $server,
>            $proc, $msg) = @_;
> 
>     # If $dbh is defined, then you can set or check attributes
>     # in the callback, which can be tested in the main body
>     # of the code.
> 
>         printf STDERR "\nServer message: (In srv_cb)\n";
>         printf STDERR "Message number: %ld, Severity %ld, ",
>                $number, $severity;
>         printf STDERR "State %ld, Line %ld\n", $state, $line;
> 
>         if (defined($server)) {
>             printf STDERR "Server '%s'\n", $server;
>         }
> 
>         if (defined($proc)) {
>             printf STDERR " Procedure '%s'\n", $proc;
>         }
> 
>         printf STDERR "Message String: %s\n", $msg;  CS_SUCCEED;
>     }
> 
> 
> Can you help please???
> 
> -----Original Message-----
> From: Michael Peppler [mailto:mpeppler@peppler.org]
> Sent: 25 October 2002 17:46
> To: SybPerl Discussion List
> Subject: Re: Problems installing Sybperl module on Windows NT ...
> 
> 
> On Fri, 2002-10-25 at 09:36, Omidiran, Ola wrote:
> > Hi,
> > 
> > I have been getting the following errors installing Sybperl on my NT
> > machine:
> > 
> >
> C:\ola\unload\sybperl-2.15.tar\sybperl-2.15\DBlib>C:\OLA_DBA_STUFF\Nmake\nma
> > ke
> > 
> > Microsoft (R) Program Maintenance Utility   Version 1.50
> > Copyright (c) Microsoft Corp 1988-94. All rights reserved.
> > 
> > cp DBlib.pm ..\blib\lib\Sybase\DBlib.pm
> > AutoSplitting ..\blib\lib\Sybase\DBlib.pm (..\blib\lib\auto\Sybase\DBlib)
> >         C:\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib
> > C:\Perl\lib\ExtUtils/xs
> > ubpp -prototypes -typemap C:\Perl\lib\ExtUtils\typemap DBlib.xs >
> DBlib.xsc
> > && C
> > :\Perl\bin\perl.exe -IC:\Perl\lib -IC:\Perl\lib -MExtUtils::Command -e mv
> > DBlib.
> > xsc DBlib.c
> >         cl -c -Ic:\Sybase1192\include -nologo -O1 -MD -DNDEBUG -DWIN32
> > -D_CONSOL
> > E -DNO_STRICT -DHAVE_DES_FCRYPT -DPERL_IMPLICIT_CONTEXT
> -DPERL_IMPLICIT_SYS
> > -DPE
> > RL_MSVCRT_READFIX -O1 -MD -DNDEBUG    -DVERSION=\"2.15\"
> > -DXS_VERSION=\"2.15\"
> >  -IC:\Perl\lib\CORE -DDBLIBVS=1000 -DSYBPLVER=\"2.15\" -DDO_TIE DBlib.c
> > The name specified is not recognized as an
> > internal or external command, operable program or batch file.
> > NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return code '0x1'
> > Stop.
> 
> 
> Err - stupid question: do you have the C compiler installed on your
> system?
> 
> Michael
> -- 
> Michael Peppler / mpeppler@peppler.org / http://www.mbay.net/~mpeppler
> mpeppler@zetatools.com / ZetaTools, Inc / http://www.zetatools.com
> ZetaTools: Call perl functions as Sybase stored procedures!
> 
> 
-- 
Michael Peppler / mpeppler@peppler.org / http://www.mbay.net/~mpeppler
mpeppler@zetatools.com / ZetaTools, Inc / http://www.zetatools.com
ZetaTools: Call perl functions as Sybase stored procedures!