freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: "Ryan D. Hatch" <Ryan AT alpinenetworking.com>
- To: "TDS Development Group" <freetds AT franklin.oit.unc.edu>
- Subject: Re: globally defined RETCODE variable
- Date: Sun, 2 Sep 2001 01:24:38 -0600
Hmm.
I recompiled tds with these commands;
./configure --prefix=/opt/freetds-0.52 --with-tdsver=4.2
make
make install
I then go and do php
./configure \
--with-apxs=/opt/apache_1.3.20/bin/apxs \
--with-sybase-ct=/opt/freetds-0.52 \
--with-ibm-db2=/home/db2inst1/sqllib
make
and it breaks. Here is what it says:
/usr/bin/ld: cannot find -lsybtcl
collect2: ld returned 1 exit status
make[1]: *** [libphp4.la] Error 1
make[1]: Leaving directory `/usr/src/apps/php-4.0.6'
make: *** [all-recursive] Error 1
Any ideas?
BTW. Before I configured and attempted to compile PHP, I put
/opt/freetds-0.52/lib in /etc/ld.so.conf and ran ldconfg.
Thanks,
Ryan
-----Original Message-----
From: Brian Bruns [mailto:camber AT ais.org]
Sent: Friday, August 31, 2001 7:47 PM
To: TDS Development Group
Subject: [freetds] Re: globally defined RETCODE variable
dblib is littered with badly named globals. If you need to compile
freetds within the same program as DB2 (or other SQL/CLI-like
interfaces) I would strongly recommend using ctlib. For php that is
--with-sybase-ct flag on the configure.
Renaming RETCODE is simply not possible, as it is a feature of the API
defined by Sybase/MS that we are implementing. Change it, and you kill
compatibility with every dblib program out there. Namespace clean up is
one of the big reasons Sybase moved to ctlib.
Brian
On Fri, 31 Aug 2001, Ryan D. Hatch wrote:
> I am using freetds 0.52, php 4.06. I am also using IBM DB2.
>
> When I tried compiling php with the following command
>
> ./configure \
> --with-apxs=/opt/apache_1.3.20/bin/apxs \
> ----with-sybase=/opt/freetds-0.52 \
> --with-ibm-db2=/home/db2inst1/sqllib
>
> It broke on me when compiling giving me a previously declared variable
> error. Here is what it said:
> In file included from /opt/freetds-0.52/include/sybfront.h:23,
> from
> /usr/src/apps/php-4.0.6/ext/sybase/php_sybase_db.h:67,
> from internal_functions.c:46:
> /opt/freetds-0.52/include/sybdb.h:72: conflicting types for
> `RETCODE'
> /home/db2inst1/sqllib/include/sqlcli.h:344: previous declaration
> of `RETCODE'
> make[2]: *** [internal_functions.lo] Error 1
> make[2]: Leaving directory `/usr/src/apps/php-4.0.6/main'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/usr/src/apps/php-4.0.6/main'
> make: *** [all-recursive] Error 1
>
> So, I changed the variable definition to read;
> typedef signed short RETCODE
> (this is how IBM did it in the DB2 include. I assume for Java
> compatibility issues)
>
> and it worked most of the way through the compile. It broke again
later
> (saying that the variable hadnt been declared), so I put it back in
and
> finished my make. It worked, and now freetds and DB2 both work
together
> nicely. I am worried though that if TDS has return codes greater than
> 127, then I could end up with it outputing negative return codes. If
the
> codes are larger that 255, then I could end up with buffer overflows.
> Does anybody have any better ways of handling this? Could I just
simply
> rename the RETCODE variable throughout the TDS source code? Perhalps a
> patch?
>
> Thanks guys.
>
> Ryan Hatch
>
> ---
> You are currently subscribed to freetds as: [camber AT ais.org]
> To unsubscribe, forward this message to
$subst('Email.Unsub')
>
---
You are currently subscribed to freetds as: [Ryan AT alpinenetworking.com]
To unsubscribe, forward this message to
$subst('Email.Unsub')
-
Re: globally defined RETCODE variable,
Ryan D. Hatch, 09/02/2001
- <Possible follow-up(s)>
- Re: globally defined RETCODE variable, Bob Kline, 09/02/2001
- Re: globally defined RETCODE variable, Ryan D. Hatch, 09/02/2001
- Re: globally defined RETCODE variable, Steve Langasek, 09/02/2001
- Re: globally defined RETCODE variable, Bob Kline, 09/02/2001
- Re: globally defined RETCODE variable, Brian Bruns, 09/02/2001
Archive powered by MHonArc 2.6.24.