Subject: ODBC with CYGWIN32 B19.1
From: [email-masked] (Ludovic LANGE)

24 Apr 1998 22:51:26 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
To: Cygnus Mailing List <[email-masked]>
Cc: [email-masked], [email-masked]

Hello,

I've seen a few questions on ODBC with cygwin32, but no answer ( On Mon,
20 Apr 1998, Giorgio ([email-masked]) , and on Tue, 7 Apr
1998, "popori" ([email-masked]))

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:[email-masked]

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".