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 dot x dot peppler at jpmchase dot com
Subject: Re: Sybase::CTlib and OCS 15 vs OCS 12.5
Date: Mar 28 2008 2:11PM

sybperl doesn't build under Cygwin, but DBD::Sybase does (as does sqsh). 
The issue had to do a some hard-coded C:\sql10 path that seems to get 
picked up instead of the real path where the libs exist.

You also need to build the .a files from the .lib files - there's a script 
to do that in the sqsh distribution  - here's the version for ASE/OCS 15:

#!/bin/sh
#
# $Id: cygwin.sh,v 1.1 2004/11/24 12:33:00 mpeppler Exp $
# Shell script to build .a libraries from Sybase's .lib files.
# Original provided by Helmut Ruholl.
#
# NOTE: Does NOT work with 12.5.1 libraries because their symbols
# are not "decorated". See the MS documentation on the __stdcall
# function call convention for details on symbol "decoration".
#

set -x
here=`pwd`

cd $SYBASE/OCS-15_0/lib
for i in libsybblk libsybcs libsybct libsybdb; do
    echo "EXPORTS" >${i}.def
    nm ${i}.lib | grep 'T _' | sed 's/.* T _//' >>${i}.def
    dlltool --dllname ${i}.dll --def ${i}.def --output-lib ${i}.a -k
done


Michael





George Brink  
28.03.2008 15:01

To
michael.x.peppler@jpmchase.com
cc

Subject
Re: Sybase::CTlib and OCS 15 vs OCS 12.5






No. If that would be the case, the script wont be able
to load OpenClient libraries at all.

But second look at the script in the morning - and I
found the typo!
In BEGIN section it should be:
 $ENV{PATH} = "$ENV{SYBASE}\\$ENV{SYBASE_OCS}\\dll";

Not just
 $ENV{PATH} = "$ENV{SYBASE}\\dll";
By some strange reason I have two different sets of
Open Client dlls in two different folders...

BTW, I tried to compile sybperl against OCS15 under
MinGW and Cygwin and failed both times - can not find
OCS libraries. Same thing with DBD::Sybase...

--- michael.x.peppler@jpmchase.com wrote:

> I don't know much about windows, but this technique
> most definitely 
> doesn't work under Unix, because most of these
> variables (in particular 
> for loading DLLs) can't be set in the process itself
> - they must be set in 
> the calling process.
> 
> Try setting these variables in a cmd window, and
> then running your script 
> to see if it helps.
> 
> Michael
> 
> 
> 
> 
> George Brink  
> Sent by: owner-sybperl-l@peppler.org
> 27.03.2008 22:16
> 
> To
> sybperl-l@peppler.org
> cc
> 
> Subject
> Sybase::CTlib and OCS 15 vs OCS 12.5
> 
> 
> 
> 
> 
> 
> I live (mostly) on windows with OCS 15, it is
> installed into c:\sql.
> I also have OCS 12.5 in c:\sql_12-5
> Installed sybperl 2.18 into ActivePerl 5.8.8
> 
> My problem is that sybperl is compiled against 12.5
> and I need to modify my environment before using it.
> So i wrote:
> ---------------- 
> BEGIN {
>                  $ENV{SYBASE}     = 'c:\sql_12-5';
>                  $ENV{SYBASE_OCS} = 'OCS-12_5';
>                  $ENV{PATH}       =
> 'c:\sql_12-5\dll';
> }
> use strict;
> use Sybase::CTlib;
> my $sybase_status = new Sybase::CTlib $db_login,
> $db_pw, $db_server or die "Can not connect to
> $db_server";
> print "Connected\n";
> -----------------
> 
> And i receive next set of messages:
> ----------------
> The context allocation routine failed.
> 
> The following problem caused the failure:
> 
> Invalid context version.
> Connected
> ----------------
> After that it works fine, I can
> select/insert/execute.
> But what is this "context allocation routine" which
> fails?
> 
> 
> 
> George Brink
> 
> 
> 
>
____________________________________________________________________________________
> Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
> 
> 
> -----------------------------------------
> This communication is for informational purposes
> only. It is not
> intended as an offer or solicitation for the
> purchase or sale of
> any financial instrument or as an official
> confirmation of any
> transaction. All market prices, data and other
> information are not
> warranted as to completeness or accuracy and are
> subject to change
> without notice. Any comments or statements made
> herein do not
> necessarily reflect those of JPMorgan Chase & Co.,
> its subsidiaries
> and affiliates.
> 
> This transmission may contain information that is
> privileged,
> confidential, legally privileged, and/or exempt from
> disclosure
> under applicable law. If you are not the intended
> recipient, you
> are hereby notified that any disclosure, copying,
> distribution, or
> use of the information contained herein (including
> any reliance
> thereon) is STRICTLY PROHIBITED. Although this
> transmission and any
> attachments are believed to be free of any virus or
> other defect
> that might affect any computer system into which it
> is received and
> opened, it is the responsibility of the recipient to
> ensure that it
> is virus free and no responsibility is accepted by
> JPMorgan Chase &
> Co., its subsidiaries and affiliates, as applicable,
> for any loss
> or damage arising in any way from its use. If you
> received this
> transmission in error, please immediately contact
> the sender and
> destroy the material in its entirety, whether in
> electronic or hard
> copy format. Thank you.
> 
> Please refer to
> http://www.jpmorgan.com/pages/disclosures for
> disclosures relating to UK legal entities.
> 


George Brink


 
____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ