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

I am trying to test DBI/DBD with Sybase 15. The system currently works with Perl 5.8.5 and a similarly old DBD.

First, I built 5.8.9, the last saved version of the 5.8 tree, and 5.12.1, the most recent (64 bit) version. Each is in its own directory:

/opt/tools/perl5.8.9

/opt/tools/perl5.12.1

setting the path to /opt/tools/perl5.8.9/bin, I installed DBI-1.613_70 that worked no problem. Same with perl5.12.1

Then, with gcc-3.4.6 on RedHat AS 4, or Sun's compiler on Solaris, I get the following error, with either version. I'm an experienced C++ programmer, I just don't have enough experience with perl interfacing to C, can anyone tell me what to do?

cc -c -I/opt/tools/sybase_oc/OCS-15_0/include -DSYB_LP64 -I/opt/tools +/perl5.12.1/lib/site_perl/5.12.1/x86_64-linux/auto/DBI -fno-strict-al +iasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_ +BITS=64 -O2 -DVERSION=\"1.10\" -DXS_VERSION=\"1.10\" -fPIC "-I/opt/ +tools/perl5.12.1/lib/5.12.1/x86_64-linux/CORE" Sybase.c Sybase.xs: In function `XS_DBD__Sybase__db__date_fmt': Sybase.xs:76: error: `sv_yes' undeclared (first use in this function) Sybase.xs:76: error: (Each undeclared identifier is reported only once Sybase.xs:76: error: for each function it appears in.) Sybase.xs:76: error: `sv_no' undeclared (first use in this function)
Here's the line of code:
void _date_fmt(dbh, fmt) SV * dbh char * fmt ALIAS: syb_date_fmt = 1 CODE: D_imp_dbh(dbh); ST(0) = syb_db_date_fmt(dbh, imp_dbh, fmt) ? &sv_yes : &sv_no;

Replies are listed 'Best First'.
Re: Compiler Errors building DBD against Sybase 15 OpenClient
by almut (Canon) on Aug 05, 2010 at 19:50 UTC

    IIRC, sv_yes and sv_no are ancient (pre-5.6). Try replacing them with PL_sv_yes/no. Or set PERL_POLLUTE.

    See also embedvar.h and Devel::PPPort

    Side note: please put <code>...</code> tags around code-like sections — instead of <pre>  (you may edit your existing node).