This is the mail archive of the
cygwin@sourceware.cygnus.com
mailing list for the Cygwin project.
Sybase and Cygwin
- To: cygwin at sourceware dot cygnus dot com
- Subject: Sybase and Cygwin
- From: peter at telnet-research dot co dot uk (Peter Hudson +44 1892 541 720)
- Date: Wed, 15 Dec 99 17:44:03 GMT
I have succeeded in using the Sybase client libraries with Cygwin. This
was achieved by following the archive mail:
http://sourceware.cygnus.com/ml/cygwin/1999-08/msg00148.html
and a follow up question with its author, Vadim Beloborodov (who should
take the credit; I'm just documenting).
To use the Sybase libraries, then:
1. create .a files from the .lib files. I could not get the Cygwin-
documented method (using nm) to work, but the following does work:
#! /bin/sh
cd $SYBASE/lib
for i in libblk libcs libct libsybdb ; do
echo "LIBRARY ${i}" >${i}.def
echo "EXPORTS" >>${i}.def
strings ${i}.lib | grep _imp | sed s/__imp__// >>${i}.def
dlltool --dllname ${i}.dll --def ${i}.def --output-lib ${i}.a -k
done
2. In your source modify prototypes for callbacks (for UNIX is _ctype,
for NT is __stdcall)
3. When compiling, define _MSC_VER=800
This gives the prototypes the appropriate calling convention (for
NT newbies such as myself, this is usually __stdcall, which explains
the @n's at the end of function names, and __cdecl for variable argument
functions)
In some older headers, vararg functions such as dbfcmd are not handled
correctly. I had to change csconfig.h to define CS_VARARGS __cdecl ,
but this is not necessary with later header files.
Peter Hudson
Telnet Research Ltd
--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com