From: Jonathan W. <jw...@mi...> - 2004-08-10 10:26:10
|
Neil, You don't say so, but I inferred from the errors you posted that you're using GCC 3.3 mysqlcppapi 1.9.0 uses too many non-standard C++ features (such as stdlib headers with .h appended) Please try v1.9.3 which contains numerous fixes to work with GCC 3.3 regards, jon http://www.mintel.com London Office: Mintel International Group Ltd (Mintel) 18-19 Long Lane London EC1A 9PL UK Tel: 020 7606 4533 Fax: 020 7606 5932 Chicago Office: Mintel International Group Ltd (Mintel) 213 West Institute Place Suite #208 Chicago IL 60610 USA Tel: 312 932 0400 Fax: 312 932 0469 Notice ******** This email may contain information that is privileged, confidential or otherwise protected from disclosure. It must not be used by, or its contents copied or disclosed to, persons other than the addressee. If you have received this email in error please notify the sender immediately and delete the email. Any views or opinions expressed in this message are solely those of the author, and do not necessarily reflect those of Mintel. No Mintel staff are authorised to make purchases using email or over the internet, and any contracts so performed are invalid. Warning ********** It is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect their systems or data. Please carry out such virus and other checks, as you consider appropriate. |
From: Jonathan W. <jw...@mi...> - 2004-08-10 14:12:27
|
Hi Neil, According to http://dev.mysql.com/doc/mysql/en/mysql_shutdown.html the second argument was added in MySQL 4.1.3 I've been compiling and testing against 4.0 (since I'm still cautious about using beta code from mysql) Could you change the offending line in mysqlcppapi/Connection.cc to this and let me know if it works? #ifdef SHUTDOWN_DEFAULT bool suc = !(mysql_shutdown(m_sharedptr_connection.obj(), SHUTDOWN_DEFAULT)); #else bool suc = !(mysql_shutdown(m_sharedptr_connection.obj())); #endif I'll look for a better way of detecting which form to use before committing, but this should let you compile against the 4.1 API regards, jon "Neil Chakrabarty" <nch...@uc...> on 10/08/2004 15:00:08 To: Jonathan Wakely/MINTEL/GB@MINTEL, mys...@li... cc: Subject: RE: install problems Jon, Thanks for the help, I am using gcc 3.3.2. I am currently trying v1.9.3 but I now get the following error when running make. g++ -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/share/mysql//mysql/include -g -O2 -MT Connection.lo -MD -MP -MF .deps/Connection.Tpo -c Connection.cc -fPIC -DPIC -o .libs/Connection.o /usr/include/mysql/mysql.h: In member function `bool mysqlcppapi::Connection::shutdown()': /usr/include/mysql/mysql.h:458: error: too few arguments to function `int mysql_shutdown(MYSQL*, enum_shutdown_level)' Connection.cc:215: error: at this point in file When I look at Connection.cc line 215, I see the following: bool suc = !(mysql_shutdown(m_sharedptr_connection.obj())); The compiler is correct in saying it is missing an argument. -Neil -----Original Message----- From: Jonathan Wakely [mailto:jw...@mi...] Sent: Tuesday, August 10, 2004 4:20 AM To: mys...@li... Cc: nch...@uc... Subject: Re: install problems Neil, You don't say so, but I inferred from the errors you posted that you're using GCC 3.3 mysqlcppapi 1.9.0 uses too many non-standard C++ features (such as stdlib headers with .h appended) Please try v1.9.3 which contains numerous fixes to work with GCC 3.3 regards, jon http://www.mintel.com London Office: Mintel International Group Ltd (Mintel) 18-19 Long Lane London EC1A 9PL UK Tel: 020 7606 4533 Fax: 020 7606 5932 Chicago Office: Mintel International Group Ltd (Mintel) 213 West Institute Place Suite #208 Chicago IL 60610 USA Tel: 312 932 0400 Fax: 312 932 0469 Notice ******** This email may contain information that is privileged, confidential or otherwise protected from disclosure. It must not be used by, or its contents copied or disclosed to, persons other than the addressee. If you have received this email in error please notify the sender immediately and delete the email. Any views or opinions expressed in this message are solely those of the author, and do not necessarily reflect those of Mintel. No Mintel staff are authorised to make purchases using email or over the internet, and any contracts so performed are invalid. Warning ********** It is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect their systems or data. Please carry out such virus and other checks, as you consider appropriate. |
From: Jonathan W. <jw...@mi...> - 2004-08-10 14:30:59
|
I've downloaded the 4.1.3 sources and that fix won't work, SHUTDOWN_DEFAULT is an enum, not a macro (bah! who uses all-caps for enums?!) but something like this should work ok: #if MYSQL_VERSION_ID >= 40103 bool suc = !(mysql_shutdown(m_sharedptr_connection.obj(), SHUTDOWN_DEFAULT)); #else bool suc = !(mysql_shutdown(m_sharedptr_connection.obj())); #endif I *think* that's the right ID for 4.1.3, it's defined in the installed mysql_version.h jon |
From: Neil C. <nch...@uc...> - 2004-08-10 15:51:03
|
The code you have provided prevents the compiler error. But now I get the following error: /usr/bin/ld: cannot find -lmysqlclient I have installed the client and library for 4.1.3.0 -----Original Message----- From: Jonathan Wakely [mailto:jw...@mi...] Sent: Tuesday, August 10, 2004 8:25 AM To: Neil Chakrabarty Cc: mys...@li... Subject: RE: install problems I've downloaded the 4.1.3 sources and that fix won't work, SHUTDOWN_DEFAULT is an enum, not a macro (bah! who uses all-caps for enums?!) but something like this should work ok: #if MYSQL_VERSION_ID >= 40103 bool suc = !(mysql_shutdown(m_sharedptr_connection.obj(), SHUTDOWN_DEFAULT)); #else bool suc = !(mysql_shutdown(m_sharedptr_connection.obj())); #endif I *think* that's the right ID for 4.1.3, it's defined in the installed mysql_version.h jon |
From: Jonathan W. <co...@co...> - 2004-08-10 18:40:25
|
(back on my usual email address now) On Tue, Aug 10, 2004 at 09:50:34AM -0600, Neil Chakrabarty wrote: > The code you have provided prevents the compiler error. Cool, thanks for testing it. I'll commit that this evening. > But now I get the following error: > /usr/bin/ld: cannot find -lmysqlclient > > I have installed the client and library for 4.1.3.0 Then you need to tell the compiler/linker where to find libmysqlclient.so with a -L switch. It's often installed in /usr/local/lib/mysql or /usr/local/mysql/lib jon > > -----Original Message----- > From: Jonathan Wakely [mailto:jw...@mi...] > Sent: Tuesday, August 10, 2004 8:25 AM > To: Neil Chakrabarty > Cc: mys...@li... > Subject: RE: install problems > > > I've downloaded the 4.1.3 sources and that fix won't work, > SHUTDOWN_DEFAULT is an enum, not a macro > (bah! who uses all-caps for enums?!) > > but something like this should work ok: > > #if MYSQL_VERSION_ID >= 40103 > bool suc = !(mysql_shutdown(m_sharedptr_connection.obj(), > SHUTDOWN_DEFAULT)); > #else > bool suc = !(mysql_shutdown(m_sharedptr_connection.obj())); > #endif > > I *think* that's the right ID for 4.1.3, it's defined in the installed > mysql_version.h > > jon > > > > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > Mysqlcppapi-main mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysqlcppapi-main -- "Political satire became obsolete when Henry Kissinger was awarded the Nobel Prize." - Tom Lehrer |
From: Neil C. <nch...@uc...> - 2004-08-10 23:06:17
|
Sorry to keep bothering, but I can't figure this error out when making the library: /bin/sh ../libtool --mode=link g++ -I/usr/share/mysql/include -g -O2 -o libmysqlcppapi-1.9.la -rpath /usr/local/lib -version-info 4:0:0 -release 1.9 ColData.lo Connection.lo Allocator_Connection.lo string_util.lo datetime/libdatetime.la exceptions/libexceptions.la fields/libfields.la query/libquery.la query_results/libquery_results.la row/librow.la -lnsl -lintl -L/usr/share/mysql/lib/mysql -lmysqlclient -L/usr/share/lib/mysql -lmysqlclient g++ -shared -nostdlib /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/../../../crti.o /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/crtbeginS.o .libs/ColData.o .libs/Connection.o .libs/Allocator_Connection.o .libs/string_util.o -Wl,--whole-archive datetime/.libs/libdatetime.a exceptions/.libs/libexceptions.a fields/.libs/libfields.a query/.libs/libquery.a query_results/.libs/libquery_results.a row/.libs/librow.a -Wl,--no-whole-archive -lnsl /usr/lib/libintl.so -L/usr/share/mysql/lib/mysql -L/usr/share/lib/mysql -lmysqlclient -L/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2 -L/usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/crtendS.o /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/../../../crtn.o -Wl,-soname -Wl,libmysqlcppapi-1.9-1.9.so.4 -o .libs/libmysqlcppapi-1.9-1.9.so.4.0.0 /usr/bin/ld: cannot find -lmysqlclient collect2: ld returned 1 exit status make[3]: *** [libmysqlcppapi-1.9.la] Error 1 make[3]: Leaving directory `/home/creus/mysqlcppapi-1.9.3/mysqlcppapi' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/creus/mysqlcppapi-1.9.3/mysqlcppapi' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/creus/mysqlcppapi-1.9.3' make: *** [all] Error 2 -----Original Message----- From: Jonathan Wakely [mailto:co...@co...] Sent: Tuesday, August 10, 2004 10:09 AM To: Neil Chakrabarty Cc: mys...@li... Subject: Re: [Mysqlcppapi-main] RE: install problems (back on my usual email address now) On Tue, Aug 10, 2004 at 09:50:34AM -0600, Neil Chakrabarty wrote: > The code you have provided prevents the compiler error. Cool, thanks for testing it. I'll commit that this evening. > But now I get the following error: > /usr/bin/ld: cannot find -lmysqlclient > > I have installed the client and library for 4.1.3.0 Then you need to tell the compiler/linker where to find libmysqlclient.so with a -L switch. It's often installed in /usr/local/lib/mysql or /usr/local/mysql/lib jon > > -----Original Message----- > From: Jonathan Wakely [mailto:jw...@mi...] > Sent: Tuesday, August 10, 2004 8:25 AM > To: Neil Chakrabarty > Cc: mys...@li... > Subject: RE: install problems > > > I've downloaded the 4.1.3 sources and that fix won't work, > SHUTDOWN_DEFAULT is an enum, not a macro > (bah! who uses all-caps for enums?!) > > but something like this should work ok: > > #if MYSQL_VERSION_ID >= 40103 > bool suc = !(mysql_shutdown(m_sharedptr_connection.obj(), > SHUTDOWN_DEFAULT)); > #else > bool suc = !(mysql_shutdown(m_sharedptr_connection.obj())); > #endif > > I *think* that's the right ID for 4.1.3, it's defined in the installed > mysql_version.h > > jon > > > > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > Mysqlcppapi-main mailing list > Mys...@li... > https://lists.sourceforge.net/lists/listinfo/mysqlcppapi-main -- "Political satire became obsolete when Henry Kissinger was awarded the Nobel Prize." - Tom Lehrer |
From: 'Jonathan W. <co...@co...> - 2004-08-11 00:43:35
|
On Tue, Aug 10, 2004 at 05:05:53PM -0600, Neil Chakrabarty wrote: > Sorry to keep bothering, but I can't figure this error out when making the > library: That's OK. I misunderstood earlier and thought you meant you had built mysqlcppapi but couldn't link your own program, so wasn't very clear. > /usr/lib/gcc-lib/i586-mandrake-linux-gnu/3.3.2/../../../crtn.o -Wl,-soname > -Wl,libmysqlcppapi-1.9-1.9.so.4 -o .libs/libmysqlcppapi-1.9-1.9.so.4.0.0 > /usr/bin/ld: cannot find -lmysqlclient ^^^^^^^^^^^^^^^^^^^^^^^^^ This is the only bit of interest, when creating the mysqlcppapi library the linker tries to find the MySQL client library, so you need to tell the linker how to find the file libmysqlclient.so You must specify the path to your mysql installation when you configure the library, by using --with-mysql e.g. ./configure --with-mysql=/usr/local/mysql --other-args ... If make still fails then you can tell the linker exactly where to find the lib by setting the LDFLAGS variable when running configure. The value of that variable will be passed directly to the linker. e.g. LDFLAGS=-L/usr/local/mysql/lib ./configure --other-args ... The directory you specify with -L in the LDFLAGS variable should be the one that contains libmysqlclient.so, which you should be able to find by typing "locate libmysqlclient". Let me know what the output of "locate" is and what options you passed to configure if you still can't build mysqlcppapi. jon -- "Probably all laws are useless; for good men do not need laws at all, and bad men are made no better by them." - Demonax the Cynic |
From: Jonathan W. <co...@co...> - 2004-08-11 14:44:47
|
> From: Jonathan Wakely [mailto:jw...@mi...] > > I've downloaded the 4.1.3 sources and that fix won't work, > SHUTDOWN_DEFAULT is an enum, not a macro > (bah! who uses all-caps for enums?!) > > but something like this should work ok: > > #if MYSQL_VERSION_ID >= 40103 > bool suc = !(mysql_shutdown(m_sharedptr_connection.obj(), > SHUTDOWN_DEFAULT)); > #else > bool suc = !(mysql_shutdown(m_sharedptr_connection.obj())); > #endif For the record ... I considered making the signature of Connection::shutdown() vary depending on the MySQL version (so you could pass in an enum_shutdown_level if compiling against 4.1.3 or higher) I decided against it for several reasons, including * Would make the mysqlcppapi API different depending what headers you compile it against. This seems like a recipe for ODR violations. (Might not be an issue since the libmysqlclient ABI changed anyway) * There's currently only one value for that enum, so no point in allowing different values to be passed in. If alternative shutdown arguments are added in the future mysqlcppapi might support them, but not right now. jon -- "In times like these, it helps to recall that there have always been times like these." - Paul Harvey |
From: Neil C. <nch...@uc...> - 2004-08-10 14:01:20
|
Jon, Thanks for the help, I am using gcc 3.3.2. I am currently trying v1.9.3 but I now get the following error when running make. g++ -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I/usr/share/mysql//mysql/include -g -O2 -MT Connection.lo -MD -MP -MF .deps/Connection.Tpo -c Connection.cc -fPIC -DPIC -o .libs/Connection.o /usr/include/mysql/mysql.h: In member function `bool mysqlcppapi::Connection::shutdown()': /usr/include/mysql/mysql.h:458: error: too few arguments to function `int mysql_shutdown(MYSQL*, enum_shutdown_level)' Connection.cc:215: error: at this point in file When I look at Connection.cc line 215, I see the following: bool suc = !(mysql_shutdown(m_sharedptr_connection.obj())); The compiler is correct in saying it is missing an argument. -Neil -----Original Message----- From: Jonathan Wakely [mailto:jw...@mi...] Sent: Tuesday, August 10, 2004 4:20 AM To: mys...@li... Cc: nch...@uc... Subject: Re: install problems Neil, You don't say so, but I inferred from the errors you posted that you're using GCC 3.3 mysqlcppapi 1.9.0 uses too many non-standard C++ features (such as stdlib headers with .h appended) Please try v1.9.3 which contains numerous fixes to work with GCC 3.3 regards, jon http://www.mintel.com London Office: Mintel International Group Ltd (Mintel) 18-19 Long Lane London EC1A 9PL UK Tel: 020 7606 4533 Fax: 020 7606 5932 Chicago Office: Mintel International Group Ltd (Mintel) 213 West Institute Place Suite #208 Chicago IL 60610 USA Tel: 312 932 0400 Fax: 312 932 0469 Notice ******** This email may contain information that is privileged, confidential or otherwise protected from disclosure. It must not be used by, or its contents copied or disclosed to, persons other than the addressee. If you have received this email in error please notify the sender immediately and delete the email. Any views or opinions expressed in this message are solely those of the author, and do not necessarily reflect those of Mintel. No Mintel staff are authorised to make purchases using email or over the internet, and any contracts so performed are invalid. Warning ********** It is the responsibility of the recipient to ensure that the onward transmission, opening or use of this message and any attachments will not adversely affect their systems or data. Please carry out such virus and other checks, as you consider appropriate. |