OpenWrt Forum Archive

Topic: mysql .ipk package

The content of this topic has been archived on 23 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

this is my c program

#include <my_global.h>
#include <mysql.h>

int main(int argc, char **argv)
{
  printf("MySQL client version: %s\n", mysql_get_client_info());

  exit(0);
}
Whenever i tried compile it shows the following error

helloworld.o: In function `main':
helloworld.c:(.text.startup+0x8): undefined reference to `mysql_get_client_info'
collect2: error: ld returned 1 exit status

how to overcome this error

You are not linking against MySQL libraries.

how to link mysql libraries

That is not an OpenWrt question, but... add "-Lpath_to_mysql_libs" to your GCC parameters.

can you show me the Makefile of linking mysql libraries

The discussion might have continued from here.