Hi all,
I am now writing an C++ application with the use of
MySQL. When I follow the tutorial in MySQL++ manual,
the application go into segmentation fault during
execution. What's the mistake I have made?
The followings are the codes and the error messages
during execution.
Codes:
#include <iostream>
#include <iomanip>
#include <sqlplus.hh>
using namespace std;
main()
{
cout << "Zeroth" << endl;
Connection con("db", "host", "name", "password");
cout << "First" << endl;
Query query = con.query();
cout << "Second" << endl;
query << "select * from test";
cout << "Third" << endl;
Result res = query.store();
cout << "Fourth" << endl;
cout << "Query: " << query.preview() << endl;
cout << "Fifth" << endl;
}
Error Message during Execution:
Zero
First
Second
Third
Segmentation fault
And the information from gdb about segmentation fault
is follow:
#0 0x4005f42f in SQLQuery::reset (this=0xbfffef48)
at sql_query1.hh:30
30 if (n >= size()) insert(end(),(n+1) -
size(), "");
I have tried both Red Hat 8.0 with g++ 3.2, MySQL
4.0, sqlplus 1.7.9, and Red Hat 7.3 with g++ 2.96,
MySQL 3.23, sqlplus 1.7.9
Thanks so much!
Regards,
Leo
__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php