David Gholami writes: > I'm having a little trouble running a program I made with mysql++1.7.8, when > I run the app it segment faults when the connect object is created. > this is what I am running > Red Hat Linux release 7.0 (Guinness) > Kernel 2.2.16-22 on an i586 > Mysql 3.23.32 > mysql++1.7.8 > gcc 2.96.2 > > here is how I compile the app > g++ temp.cpp -I/usr/local/mysql/include/mysql -L/usr/local/mysql/lib/mysql > -lsqlplus -Wl,--rpath=/usr/local/mysql/lib/mysql > > here is the code > #include <sqlplus.hh> > #include <iostream.h> > int main() > { > cout <<" startup" << endl; > Connection con("temp","localhost","root","temp",3306,0,60,1,"",0); > cout << "done" << endl; > return 0; > } > > here is the output > startup > Segmentation fault (core dumped) > > here is what causes it to crash > Starting program: /home/projects/code/isv/join/a.out > startup > Program received signal SIGSEGV, Segmentation fault. > chunk_free (ar_ptr=0x464c457f, p=0x4005f198) at malloc.c:3071 > 3071 malloc.c: No such file or directory. > > now back traceing it > #0 chunk_free (ar_ptr=0x464c457f, p=0x4005f198) at malloc.c:3071 > #1 0x401415fc in __libc_free (mem=0x4005f1a0) at malloc.c:3043 > #2 0x40200d25 in my_no_flags_free () from > /usr/local/mysql/lib/mysql/libmysqlclient.so.10 > #3 0x401fc929 in mysql_real_connect () from > /usr/local/mysql/lib/mysql/libmysqlclient.so.10 > #4 0x4002dfa4 in MysqlConnection::real_connect (this=0xbffff8b0, > db=0x8048c02 "temp", host=0x8048bf8 "localhost", > user=0x8048bf3 "root", passwd=0x8048bed "temp", port=3306, compress=0, > connect_timeout=60, socket_name=0x8048bec "", > client_flag=0) at connection.cc:49 > #5 0x4002dc7e in MysqlConnection::MysqlConnection (this=0xbffff8b0, > db=0x8048c02 "temp", host=0x8048bf8 "localhost", > user=0x8048bf3 "root", passwd=0x8048bed "temp", port=3306, compress=0 > '\000', connect_timeout=60, te=true, > socket_name=0x8048bec "", client_flag=0) at connection.cc:29 > #6 0x8048a9f in main () > #7 0x400e5790 in __libc_start_main (main=0x8048a2c <main>, argc=1, > ubp_av=0xbffffb24, init=0x8048860 <_init>, > fini=0x8048bbc <_fini>, rtld_fini=0x4000d35c <_dl_fini>, > stack_end=0xbffffb1c) at ../sysdeps/generic/libc-start.c:111 > > > any help to remedy this problem would be great. > > David Hi! You should not use gcc 2.95 with MySQL++, as it is still not a stable compiler. Please use 2.95.2. Also use this connection.cc and rebuild again MySQL++.
Regards, Sinisa ____ __ _____ _____ ___ == MySQL AB /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic /*/ /*/ /*/ \*\_ |*| |*||*| mailto:[EMAIL PROTECTED] /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ /*/ \*\ Developers Team
--------------------------------------------------------------------- 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