From: Javi <ja...@gs...> - 2004-03-16 15:18:47
|
Hi all. First, I think there is a problem with the Makefile. The configure script detects I have MySQL and pluging_mysql.c is compiled, but when compiling, it shows errors like: undefined reference to `mysql_init' undefined reference to `mysql_real_connect' etc It's because MySQL libraries are in the mysqlclient library. So while compiling a MySQL program, it is necessary to add the -lmysqlclient compiler option. I don't know how makefile is generated, but it should include the -lmysqlclient compiler option if MySQL is installed. I've patched manually the Makefile adding "CC = gcc -lmysqlclient" but it is not very elegant. Now I return to my "loved" Segmentation fault ;) remeber: > > The problem is wherever I use cfg_get() function I get "Segmentation > > fault" when running lcd4linux. > > Can you send me the code? I enclose the code and a sample lcd4linux.conf. In order to test MySQL pluging , just change the display settings to fit your display. I've also created a MySQL account on my server, so developers can test the pluging (Only select privileges). Server, login, password and db are listed in the sample lcd4linux.conf file. Here is gdb output: Program received signal SIGSEGV, Segmentation fault. 0x080642a4 in cfg_get () (gdb) bt #0 0x080642a4 in cfg_get () #1 0x080552a1 in plugin_init_mysql () at plugin_mysql.c:143 #2 0x08050bc6 in plugin_init () at plugin.c:209 #3 0x0804a7c9 in main (argc=3, argv=0x1) at lcd4linux.c:529 Bye Javi. |