Subject: Re: Crash of mysql under cygwin with g++ 3.3.1
From: "Gerrit P. Haase" <[email-masked]>
To: Fabrice Marchal <[email-masked]>
Cc: "Gerrit @ cygwin" <[email-masked]>
Date: Sat, 28 Feb 2004 01:59:09 +0100

Hallo Fabrice,

Am Dienstag, 24. Februar 2004 um 17:37 schriebst du:

> Hallo Gerrit,

> Thanks for your help. I would like to ask you a few questions:

> 1) If I use your mysql-4.0.17 libraries, that is if I link my code 
> against your libmysqlclient.a
> then my code works OK. On the other hand, then it requires 
> cygmysqlclient.dll also: what is
> that library exactly? Is it the equivalent of mySQL.dll which is 
> included in the mysql for windows?

Yes, the .dll is the runtime and the .a lib is used by the linker to
resolve the symbols.

> 2) I have now identified the bug, or at least what causes it: here is
> small example that
> crashes when using cygwin-1-5-7.1, MYSQL 4.0.18 and GCC3.3.1 (G++):

> #include <mysql.h>
> #include <iostream>
> using namespace std;

> class Connection{
>    MYSQL* mqlh;
> public:
>  Connection(){
>    mqlh = mysql_init( NULL );
>    cout << "OK" << endl;
>  }
> };

> int main( int argc, char** args ){
>    Connection* con = new Connection();
>    // crashes here
> }

> As you can see, it seems that something is really wrong. It seems to be
> caused by new()
> since removing the mysql_init() from the new() call seems to work.
> I have to mention that I link only against -lmySQL which is provided in
> the mysql for
> windows distro. Maybe that is the problem (i.e. it was build from older
> cygwin releases)

> As I would like to ship a "clean" version, I don't know what to do. 
> Normally, people
> would install mysql-for-win, then install my code plus just the cygwin DLL.

Obviously the official MySQL binary from mysql.com doesn't work...
Why don't you provide a MySQL client library compiled by yourself?
Or you may fetch the binaries from my site and take the .dll from this
package and ship it in addition to your application?

Gerrit
-- 
=^..^=

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/