Mysql.h showing compile errors in eclipse [message #990211] |
Tue, 11 December 2012 07:18  |
Eclipse User |
|
|
|
Hai,
I'm trying to use mysql with Eclipse IDE.
I've installed mysql and included the header file in my program.
#include <my_global.h>
#include <mysql.h>
But when I compiled it, it is giving these errors.....
: undefined reference to `mysql_init'
: undefined reference to `mysql_real_connect'
: undefined reference to `mysql_error'
: undefined reference to `mysql_query'
: undefined reference to `mysql_error'
: undefined reference to `mysql_use_result'
: undefined reference to `mysql_fetch_row'
: undefined reference to `mysql_free_result'
: undefined reference to `mysql_close'
collect2: ld returned 1 exit status
When I do Ctrl+Click on any of these functions, the editor correctly opens the header file.
Can I know where to add the libraries, include paths and linker flags of mysql in eclipse.
I'm using redhat enterprise linux 6.1 and Eclipse Juno
Thank you
|
|
|
|
|
|
Re: Mysql.h showing compile errors in eclipse [message #990751 is a reply to message #990616] |
Fri, 14 December 2012 00:39  |
Eclipse User |
|
|
|
Hai,
Thanks for your reply.
I've added pkg-config, but I didn't see anything for mysql there.
using terminal, I can compile and link C file as
gcc -o exe $(mysql_config --cflags) main.c $(mysql_config --libs)
But, in eclipse I am not able to link it. I might be doing something wrong.
Thanks
|
|
|
Powered by
FUDForum. Page generated in 0.38931 seconds