Mail Archives: cygwin/1998/04/24/22:51:26
Hello,
I've seen a few questions on ODBC with cygwin32, but no answer ( On Mon,
20 Apr 1998, Giorgio (busatto AT wi DOT leidenuniv DOT nl) , and on Tue, 7 Apr
1998, "popori" (entry AT cybertek DOT co DOT 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 AT capgemini DOT fr
-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -