From: llange@capgemini.fr (Ludovic LANGE)
Subject: ODBC with CYGWIN32 B19.1
24 Apr 1998 22:51:26 -0700
Message-ID: <3540827C.93082F30.cygnus.gnu-win32@capgemini.fr>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
To: Cygnus Mailing List <gnu-win32@cygnus.com>
Cc: busatto@wi.leidenuniv.nl, entry@cybertek.co.kr

Hello,

I've seen a few questions on ODBC with cygwin32, but no answer ( On Mon,
20 Apr 1998, Giorgio (busatto@wi.leidenuniv.nl) , and on Tue, 7 Apr
1998, "popori" (entry@cybertek.co.kr))

I have myself a few questions concerning the following piece of code
:"odbc.c"

**********************************************************************

#include <stdio.h>

#ifdef __CYGWIN32__
typedef signed short RETCODE;
typedef void * HENV;
extern RETCODE SQLAllocEnv(HENV * phenv);
extern RETCODE SQLFreeEnv(HENV phenv);
#else
#ifdef _WIN32
#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#else
#include <iodbc.h>
#include <isql.h>
#include <isqlext.h>
#endif    /* _WIN32*/
#endif    /* __CYGWIN32__*/

int main()
{
    HENV        myHenv;
    RETCODE     myRetCode;
    printf("Trying to allocate an environment handle.\n");
    myRetCode = SQLAllocEnv( &myHenv );
    printf("Return code : %x  ; Handle : %x \n",myRetCode,myHenv);
    myRetCode = SQLFreeEnv( myHenv );
    return 0;
}

**********************************************************************

Compiled under :

Windows NT with "cl odbc.c -link odbc32.lib"    (ie MSVC) it compiles
OK,
Any Unix with "gcc odbc.c -liodbc"       it compiles OK,

But with CygWin32, with "gcc odbc.c -lodbc32" it doesn't work and ends
with :
C:\TEMP\cc0022121.o(.text+0x6d):odbc.c: undefined reference to
`SQLAllocEnv'
C:\TEMP\cc0022121.o(.text+0x95):odbc.c: undefined reference to
`SQLFreeEnv'

How may I use "libodbc32.a" wich is part of the CygWin32 distribution ?

If anybody ever succeeded in linking with ODBC, I would be glad to know
how...

Sincerly,

--
--- Ludovic LANGE
--- Ingénieur d'études chez Cap Gemini Telecom France
--- mailto:llange@capgemini.fr


-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request@cygnus.com" with one line of text: "help".
