Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Sat, 28 Feb 2004 01:59:09 +0100 From: "Gerrit P. Haase" Reply-To: "Gerrit @ cygwin" Organization: Esse keine toten Tiere Message-ID: <15954380034.20040228015909@familiehaase.de> To: Fabrice Marchal CC: "Gerrit @ cygwin" Subject: Re: Crash of mysql under cygwin with g++ 3.3.1 In-Reply-To: <403B7DC5.7020600@inf.ethz.ch> References: <1256769927 DOT 20040104213024 AT familiehaase DOT de> <403B7DC5 DOT 7020600 AT inf DOT ethz DOT ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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 > #include > 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/