SOLVED (at last) Re: c program Bus Error (core dumped)

2005-01-11 Thread Andy Ford
It was mentioned by the two people cc'd in this mail that the mixture of a 64bit mysqld and libraries with a 32-bit gcc/g++ was not a good idea. How right they were!! I have just installed the latest 4.1.8 32-bit Solaris 2.8 binary and it all works wonderfully. Thanks for all of your help Andy

Re: c program Bus Error (core dumped)

2005-01-11 Thread Jose Miguel Pérez
Hi Andy! > After compiling with the options (as suggested by Jose Miguel Pérez) [...] > I now get ... > Everything Cool with the connection > Bus Error (core dumped) > > Sound familiar!! Sorry Andy but I couldn't help any more. I am not familiar with Solaris, not even with 64 bit machines

Re: c program Bus Error (core dumped)

2005-01-11 Thread Andy Ford
After compiling with the options (as suggested by Jose Miguel Pérez) g++ -m64 -o check check.cpp -L/usr/local/mysql/lib -L/usr/local/lib/sparcv9 -L/usr/lib -lmysqlclient -lsocket -lnsl -lm ... and getting the subsequent error when running the compiled binary 'check'... ld.so.1: ./check: fata

Re: c program Bus Error (core dumped)

2005-01-11 Thread Andy Ford
I have a slight variation on that for my Solaris 2.8 machine... >g++ -m64 -o check check.cpp -L/usr/local/mysql/lib -L/usr/local/lib/sparcv9/ -lmysqlclient -lsocket -lnsl -lm // this part works fine When running 'check' I get ... >check ld.so.1: ./check: fatal: libstdc++.so.5: open failed: No suc

Re: c program Bus Error (core dumped)

2005-01-11 Thread Jose Miguel Pérez
Hi Andy! > but I still get the Bus Error message with the following code... > int main(char **args) { > MYSQL_RES *result; > MYSQL_ROW row; > MYSQL *connection, mysql; > int state; > int PORTNUM = 3306; [...] Andy, I have copied and pasted your code into a fresh new check.

Re: c program Bus Error (core dumped)

2005-01-11 Thread Andy Ford
I can get something working however. int main(char **args) { MYSQL_RES *result; MYSQL_ROW row; MYSQL *connection, mysql; char *serverInfo=""; int state; int PORTNUM = 3306; unsigned long int version; mysql_init(&mysql); connection = mysql_real_connect(&mysq

Re: c program Bus Error (core dumped)

2005-01-11 Thread Andy Ford
Thanks Jose ... but I still get the Bus Error message with the following code... int main(char **args) { MYSQL_RES *result; MYSQL_ROW row; MYSQL *connection, mysql; int state; int PORTNUM = 3306; mysql_init(&mysql); connection = mysql_real_connect(&mysql, "localhost"

Re: c program Bus Error (core dumped)

2005-01-11 Thread Jose Miguel Pérez
Hi Andy, > state = mysql_query(connection, "SELECT * from mytable"); *** ^^ > if( state ) { > printf(mysql_error(connection)); > return 1; > } else { > printf("Everything Cool with the query\n"); > } // New code,

Re: c program Bus Error (core dumped)

2005-01-11 Thread Andy Ford
I can send the truss output of anyone can decipher it!! Regards Andy On Tue, 2005-01-11 at 13:05 +, Andy Ford wrote: > Hi everyone. > > I have been trying to write a simple c program to access a local mySQL > database (with the help of David Logan). With the following code I am > getting th

c program Bus Error (core dumped)

2005-01-11 Thread Andy Ford
Hi everyone. I have been trying to write a simple c program to access a local mySQL database (with the help of David Logan). With the following code I am getting the error ... Bus Error (core dumped) ... when I run my compiled program 'test'. [code] int main(char **args) { MYSQL_RES