From: Liu, Y. <Yig...@an...> - 2004-08-05 15:18:47
|
Hi there, Thanks for the reply. Another question, I tried simple1 (the first example) and I have no database server running locally, so it fails. However, it will crash the whole program, not close down gracely. I check simple1.cc, although there are catch statement for exceptions and I also add catch(...) to catch all other exceptions, it still crashes. Does exception-handling work in mysqlcppapi? Thanks a lot Yigong -----Original Message----- From: Jonathan Wakely [mailto:co...@co...]=20 Sent: Thursday, August 05, 2004 5:25 AM To: Liu, Yigong Cc: mys...@li... Subject: Re: [Mysqlcppapi-main] where to find libmysqlclient.so for Solaris 2.8 with gcc 3.3 On Wed, Aug 04, 2004 at 06:09:59PM -0400, Liu, Yigong wrote: > Hi there, Murray and any other experts, Hi, > I am building mysqlcppapi1.9.3 on Solaris2.8 with gcc3.3.2. Everything > went good until I hit "ld : cannot find -lmysqlclient." I assume this is when linking, not when running, the program? > Could you please give me some hints about where I can find it? On a number of systems mysql libs are installed in ${prefix}/lib/mysql/ rather than ${prefix}/lib So you might want to try -L/usr/local/mysql/lib/mysql or similar. These pages might help too: http://dev.mysql.com/doc/mysql/en/Solaris.html http://dev.mysql.com/doc/mysql/en/Solaris_2.7.html http://dev.mysql.com/doc/mysql/en/Installation_layouts.html Hope that helps, jon --=20 "More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity." - W.A. Wulf ---------------------------------------------------------------------------= --------------------- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. =20 If you have received it in error, please notify the sender immediately and delete the original. Any unauthorized use of this email is prohibited. ---------------------------------------------------------------------------= --------------------- [mf2] |
From: Liu, Y. <Yig...@an...> - 2004-08-05 17:05:59
|
Also for some reasons I cannot start mysql daemon locally. So I tried to connect to a remote server with simple changes to simple1.cc. I added con.set_Host, set_User, set_Passwd(). It still crashes. Any clue? I tried mysql++, at least it allows me to connect to the remote server; although it has the same issue of exception handling. Thanks Yigong -----Original Message----- From: Liu, Yigong=20 Sent: Thursday, August 05, 2004 11:23 AM To: 'Jonathan Wakely' Cc: mys...@li... Subject: RE: [Mysqlcppapi-main] where to find libmysqlclient.so for Solaris 2.8 with gcc 3.3 Hi there, Thanks for the reply. Another question, I tried simple1 (the first example) and I have no database server running locally, so it fails. However, it will crash the whole program, not close down gracely. I check simple1.cc, although there are catch statement for exceptions and I also add catch(...) to catch all other exceptions, it still crashes. Does exception-handling work in mysqlcppapi? Thanks a lot Yigong -----Original Message----- From: Jonathan Wakely [mailto:co...@co...]=20 Sent: Thursday, August 05, 2004 5:25 AM To: Liu, Yigong Cc: mys...@li... Subject: Re: [Mysqlcppapi-main] where to find libmysqlclient.so for Solaris 2.8 with gcc 3.3 On Wed, Aug 04, 2004 at 06:09:59PM -0400, Liu, Yigong wrote: > Hi there, Murray and any other experts, Hi, > I am building mysqlcppapi1.9.3 on Solaris2.8 with gcc3.3.2. Everything > went good until I hit "ld : cannot find -lmysqlclient." I assume this is when linking, not when running, the program? > Could you please give me some hints about where I can find it? On a number of systems mysql libs are installed in ${prefix}/lib/mysql/ rather than ${prefix}/lib So you might want to try -L/usr/local/mysql/lib/mysql or similar. These pages might help too: http://dev.mysql.com/doc/mysql/en/Solaris.html http://dev.mysql.com/doc/mysql/en/Solaris_2.7.html http://dev.mysql.com/doc/mysql/en/Installation_layouts.html Hope that helps, jon --=20 "More computing sins are committed in the name of efficiency (without necessarily achieving it) than for any other single reason - including blind stupidity." - W.A. Wulf ---------------------------------------------------------------------------= --------------------- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. =20 If you have received it in error, please notify the sender immediately and delete the original. Any unauthorized use of this email is prohibited. ---------------------------------------------------------------------------= --------------------- [mf2] |
From: Jonathan W. <co...@co...> - 2004-08-05 17:16:50
|
On Thu, Aug 05, 2004 at 11:21:58AM -0400, Liu, Yigong wrote: > Also for some reasons I cannot start mysql daemon locally. So I tried to > connect to a remote server with simple changes to simple1.cc. > > I added con.set_Host, set_User, set_Passwd(). It still crashes. Any > clue? Hello again, I'll take a look at your problems when I get home in a couple of hours. Sorry for the delay, jon > > I tried mysql++, at least it allows me to connect to the remote server; > although it has the same issue of exception handling. > > Thanks > > Yigong > > > -----Original Message----- > From: Liu, Yigong > Sent: Thursday, August 05, 2004 11:23 AM > To: 'Jonathan Wakely' > Cc: mys...@li... > Subject: RE: [Mysqlcppapi-main] where to find libmysqlclient.so for > Solaris 2.8 with gcc 3.3 > > Hi there, > > Thanks for the reply. > > Another question, I tried simple1 (the first example) and I have no > database server running locally, so it fails. However, it will crash the > whole program, not close down gracely. I check simple1.cc, although > there are catch statement for exceptions and I also add catch(...) to > catch all other exceptions, it still crashes. Does exception-handling > work in mysqlcppapi? > > Thanks a lot > Yigong > > > -----Original Message----- > From: Jonathan Wakely [mailto:co...@co...] > Sent: Thursday, August 05, 2004 5:25 AM > To: Liu, Yigong > Cc: mys...@li... > Subject: Re: [Mysqlcppapi-main] where to find libmysqlclient.so for > Solaris 2.8 with gcc 3.3 > > On Wed, Aug 04, 2004 at 06:09:59PM -0400, Liu, Yigong wrote: > > > Hi there, Murray and any other experts, > > Hi, > > > I am building mysqlcppapi1.9.3 on Solaris2.8 with gcc3.3.2. Everything > > went good until I hit "ld : cannot find -lmysqlclient." > > I assume this is when linking, not when running, the program? > > > Could you please give me some hints about where I can find it? > > On a number of systems mysql libs are installed in ${prefix}/lib/mysql/ > rather than ${prefix}/lib > > So you might want to try -L/usr/local/mysql/lib/mysql or similar. > > These pages might help too: > http://dev.mysql.com/doc/mysql/en/Solaris.html > http://dev.mysql.com/doc/mysql/en/Solaris_2.7.html > http://dev.mysql.com/doc/mysql/en/Installation_layouts.html > > Hope that helps, > > jon > > -- > "More computing sins are committed in the name of efficiency > (without necessarily achieving it) than for any other single reason > - including blind stupidity." > - W.A. Wulf > > > ------------------------------------------------------------------------------------------------ > This message is for the designated recipient only and may > contain privileged, proprietary, or otherwise private information. > If you have received it in error, please notify the sender > immediately and delete the original. Any unauthorized use of > this email is prohibited. > ------------------------------------------------------------------------------------------------ > [mf2] -- "Death to all fanatics!" - Mal2 |
From: Liu, Y. <Yig...@an...> - 2004-08-10 14:23:04
|
Hi Jonathan, Thanks for your reply. It happens during connection setup. I added a pair of printout statements before and after each line in the code. Here are what I got: bash-2.03$ ./simple1 before mysqlcppapi::Connection con;... after mysqlcppapi::Connection con;... before con.connect();... Bus Error (core dumped) bash-2.03$ And I got the stack trace here: #0 0xff0422f0 in _free_unlocked () from /usr/lib/libc.so.1 (gdb) bt #0 0xff0422f0 in _free_unlocked () from /usr/lib/libc.so.1 #1 0xff0422a8 in free () from /usr/lib/libc.so.1 #2 0xff307490 in mysql_close () from /usr/local/lib/libmysqlclient.so.10 (gdb) q And exception handling works for my c++ program. I can throw and catch exceptions. Thanks a lot for your kind help! Yigong -----Original Message----- From: Jonathan Wakely [mailto:co...@co...]=20 Sent: Tuesday, August 10, 2004 7:36 AM To: Liu, Yigong Cc: mys...@li... Subject: Re: [Mysqlcppapi-main] where to find libmysqlclient.so for Solaris 2.8 with gcc 3.3 On Thu, Aug 05, 2004 at 11:16:43AM -0400, Liu, Yigong wrote: > Hi there, hi again, yigong > Thanks for the reply. >=20 > Another question, I tried simple1 (the first example) and I have no > database server running locally, so it fails. However, it will crash the > whole program, not close down gracely. I check simple1.cc, although > there are catch statement for exceptions and I also add catch(...) to > catch all other exceptions, it still crashes. Does exception-handling > work in mysqlcppapi? It works for me - if the connection is not opened an exception is thrown and caught by the first catch() block. Have you debugged the program to see where the crash is? It could be before the exception is even thrown, or it could be a problem with exception-handling in your environment. If you can send a stacktrace I might be able to figure it out. jon --=20 "Nothing is true. Everything is permissible." - Hassan i Sabbah ---------------------------------------------------------------------------= --------------------- This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. =20 If you have received it in error, please notify the sender immediately and delete the original. Any unauthorized use of this email is prohibited. ---------------------------------------------------------------------------= --------------------- [mf2] |
From: Jonathan W. <co...@co...> - 2004-08-10 11:36:40
|
On Thu, Aug 05, 2004 at 11:16:43AM -0400, Liu, Yigong wrote: > Hi there, hi again, yigong > Thanks for the reply. > > Another question, I tried simple1 (the first example) and I have no > database server running locally, so it fails. However, it will crash the > whole program, not close down gracely. I check simple1.cc, although > there are catch statement for exceptions and I also add catch(...) to > catch all other exceptions, it still crashes. Does exception-handling > work in mysqlcppapi? It works for me - if the connection is not opened an exception is thrown and caught by the first catch() block. Have you debugged the program to see where the crash is? It could be before the exception is even thrown, or it could be a problem with exception-handling in your environment. If you can send a stacktrace I might be able to figure it out. jon -- "Nothing is true. Everything is permissible." - Hassan i Sabbah |