Hi Andy,

Are you using a 64bit option to compile your program (I can't remember
the option on gcc -m64 I think)? Looks like a 64bit mysql library trying
to talk to a 32 bit program. I'm no expert but I had similar problems
when I put a 64bit mysql on one of my Solaris boxen and tried to talk
with a 32 bit perl implementation.

Regards 


David Logan
Database Administrator
HP Managed Services
148 Frome Street,
Adelaide 5000
Australia

+61 8 8408 4273 - Work
+61 417 268 665 - Mobile
+61 8 8408 4259 - Fax


-----Original Message-----
From: Andy Ford [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, 11 January 2005 8:59 PM
To: mysql@lists.mysql.com
Subject: compilation errors in mySQL C app

Hi everyone

I am trying to compile a simple C program to connect to a mySQL database
(on localhost) and run a simple query.

I am getting the following errors...

>gcc test.c -L/usr/local/mysql/lib -lmysqlclient -o test

ld: warning: file /usr/local/mysql/lib/libmysqlclient.a(libmysql.o):
wrong ELF class: ELFCLASS64
Undefined                       first referenced
 symbol                             in file
mysql_query                         /var/tmp//ccpHcO9u.o
mysql_init                          /var/tmp//ccpHcO9u.o
mysql_close                         /var/tmp//ccpHcO9u.o
mysql_free_result                   /var/tmp//ccpHcO9u.o
mysql_num_rows                      /var/tmp//ccpHcO9u.o
mysql_error                         /var/tmp//ccpHcO9u.o
mysql_store_result                  /var/tmp//ccpHcO9u.o
mysql_real_connect                  /var/tmp//ccpHcO9u.o
mysql_fetch_row                     /var/tmp//ccpHcO9u.o

ld: fatal: Symbol referencing errors. No output written to test2
collect2: ld returned 1 exit status

Any ideas how I can fix these?

Thanks

Andy
-- 
perl -e "print qq^bIG VeRN ! ^^qq^#'#Yv#=<D+ ^"

This e-mail is private and may be confidential and is for the intended
recipient only.  If misdirected, please notify us by telephone and
confirm that it has been deleted from your system and any copies
destroyed.  If you are not the intended recipient you are strictly
prohibited from using, printing, copying, distributing or disseminating
this e-mail or any information contained in it.  We use reasonable
endeavours to virus scan all e-mails leaving the Company but no warranty
is given that this e-mail and any attachments are virus free.  You
should undertake your own virus checking.  The right to monitor e-mail
communications through our network is reserved by us. 



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to