Problem Compiling/Linking
Posted by: Gerry Kooyman
Date: June 26, 2010 09:15PM

Hi all, I downloaded the MySQL C connector for Linux,

Followed all the make instructions (I think)!

every time I try to compile/link the test program, I get the following :-

gkooyman@Svr01:~/Documents/source$ gcc -o sqltest sqltest.c
/tmp/cch7Sgwc.o: In function `main':
sqltest.c:(.text+0x22): undefined reference to `mysql_server_init'
sqltest.c:(.text+0x2e): undefined reference to `mysql_init'
sqltest.c:(.text+0x50): undefined reference to `mysql_options'
sqltest.c:(.text+0x6d): undefined reference to `mysql_options'
sqltest.c:(.text+0xb2): undefined reference to `mysql_real_connect'
sqltest.c:(.text+0xc7): undefined reference to `mysql_query'
sqltest.c:(.text+0xd4): undefined reference to `mysql_store_result'
sqltest.c:(.text+0x10e): undefined reference to `mysql_fetch_row'
sqltest.c:(.text+0x129): undefined reference to `mysql_free_result'
sqltest.c:(.text+0x136): undefined reference to `mysql_close'
sqltest.c:(.text+0x13b): undefined reference to `mysql_server_end'
collect2: ld returned 1 exit status

I think it is a link problem, can anyone help please.

Options: ReplyQuote


Subject
Views
Written By
Posted
Problem Compiling/Linking
3793
June 26, 2010 09:15PM
1883
July 06, 2010 03:00AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.