delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/03/10/05:36:08

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <3.0.6.32.20000310103225.00a32210@vengeance>
X-Sender: jules AT vengeance
X-Mailer: QUALCOMM Windows Eudora Light Version 3.0.6 (32)
Date: Fri, 10 Mar 2000 10:32:25 +0000
To: Stipe Tolj <tolj AT infomatec-pwi DOT de>
From: Julian Hall <jules AT acris DOT co DOT uk>
Subject: Re: Linking with MySQL client libs, stdcall fns
Cc: cygwin AT sourceware DOT cygnus DOT com
In-Reply-To: <38C3EEE0.8B78442A@infomatec-pwi.de>
References: <3 DOT 0 DOT 6 DOT 32 DOT 20000306134617 DOT 0098ac40 AT vengeance>
Mime-Version: 1.0

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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019