Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com Date: Wed, 15 Dec 99 17:44:03 GMT From: peter AT telnet-research DOT co DOT uk (Peter Hudson +44 1892 541 720) Message-Id: <9912151744.AA03333@telnet-research.co.uk> To: cygwin AT sourceware DOT cygnus DOT com Subject: Sybase and Cygwin 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 AT sourceware DOT cygnus DOT com