Sybase and Cygwin

Peter Hudson +44 1892 541 720
Thu Dec 16 02:42:00 GMT 1999

I have succeeded in using the Sybase client libraries with Cygwin. This
was achieved by following the archive mail:
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

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

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

More information about the Cygwin mailing list