From: garp AT opustel DOT com (Keith Gary Boyce ) Subject: Re: linking with ODBC library 15 Jan 1997 15:31:11 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: References: <32DCC691 DOT 2174 AT ixos-leipzig DOT de> Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Original-To: gnu-win32 AT cygnus DOT com, Gunther Ebert X-Mailer: Chameleon ATX 6.0.1, Standards Based IntraNet Solutions, NetManage Inc. X-Face: ^DH_.wR&WxVpl/6xSwb1zT".+d0hm%R>&bOD: y{? X-Priority: 3 (Normal) Original-Sender: owner-gnu-win32 AT cygnus DOT com If anyone in interested wxwin port has a sample program linking with odbc library... --- On Wed, 15 Jan 1997 12:59:13 +0100 Gunther Ebert wrote: Hi, it looks like the function prototypes for the ODBC functions are missing or incorrect. Please check your header files if the prototypes are there and if - all functions are declared as _stdcall (_stdcall is hidden in the WINAPI or STDCALL macros), that means your prototypes have to look like int WINAPI func(); You have to do this because the name mangling of _stdcall functions is different from the one of 'normal' functions. - there are no parameter types used which are smaller than 4 bytes because all Win32 API function parameters have to be dword-aligned and gcc doesn't do this automatically. Bad prototype: int WINAPI func(WORD param); Good prototype: int WINAPI func(DWORD param); You have to change all Win32 API parameter types which are smaller than 4 bytes to DWORD even if the parameter types are actually CHAR or WORD. You have to care about this because the total number of bytes passed as parameters to a Win32 API function is part of the name mangling of these functions. Gunther Henry Minsky wrote: > > I am trying to compile a program on Windows NT which calls the ODBC > DLL library. There is a library in the gnu-win32 distribution called > libodbc32.a, but when I add the library on the gcc command line, I > still get undefined link references for all the ODBC functions. Does > anyone have any experience linking with the ODBC routines, and have an > idea what might be the problem? > > Thanks, > Henry > - > For help on using this list, send a message to > "gnu-win32-request AT cygnus DOT com" with one line of text: "help". - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help". ---------------End of Original Message----------------- ------------------------------------- Name: Garry Boyce E-mail: garp AT opustel DOT opustel DOT com (Garry Boyce) Date: 12/01/94 Time: 08:46:10 This message was sent by Chameleon ------------------------------------- - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".