This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Linking with MySQL client libs, stdcall fns


At 06:46 PM 3/6/00 +0100, Stipe Tolj wrote:
>Hi,
>
>> I'm currently trying to link with the MySQL client libraries
>> to connect to a MySQL server running on my LAN.  I have downloaded
>> the Win32 .dll & .lib file from MySQL's home page (http://www.mysql.org/),
>> but have found a strange problem with
>> actually linking with these libraries.
>
>the client libs and applications from mysql-3.22.x can be compiled as Cygwin
>build from the source tree itself. The "Cygwin Porting Project" has provided
>pre-compiled libs of libmysqlclient.a and the mysql client applications to
TcX.
>They are available as downloads on the official site.
>
>The library can be found on our web site at
>
>    http://www.student.uni-koeln.de/cygwin/
>
>The mysqld daemon is currently not Cygwin supported due to the fact that
Cygwin
>is still lacking the full functionality of the phtreads.
>
>Regards,
>Stipe
>

A couple of brief notes I've made on this port; first, it seems not to
co-operate in any way with the windows.h header file; there is a complaint
if this is included about multiple definitions of 'STDCALL', and a parse
error referencing a type of 'uint', which is not declared.  I solved these
problems by modifying mysql.h to put a '#ifndef STDCALL' wrapper around the
'#define STDCALL ...' section, and by declaring uint in my code with
'typedef unsigned int uint'.

However, I now cannot link for the opposite reason; the header file
declares the functions as stdcall, whereas in the library they are using
the cdecl conventions!

I did eventually manage to get a compile out of the system, with
the following header file declarations:

#include <stdio.h>
typedef unsigned int uint;
#include <mysql/mysql.h>
#undef STDCALL
#include <windows.h>

I do note, however, that the client libraries supplied require cygwin; with
the -mno-cygwin compile option there are many linker errors.  But, I think
I can get it working with the header files you supplied and the
libmySQL.{lib,dll} files from the MySQL web site!

Thanks for the help!

Jules




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]