LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   mysql integrate syslog-ng program error (https://www.linuxquestions.org/questions/programming-9/mysql-integrate-syslog-ng-program-error-596569/)

raiux 11-02-2007 06:03 AM

mysql integrate syslog-ng program error
 
Hello fends ,
I am working on a syslog-ng 1.6.11 code so that to a write a kernel log message directly to the mysql , for that i have write down the mysql program (#include "/usr/include/mysql mysql" ) , mean i have integrate with syslog-ng code .

Problem :- Syslog-ng need libol for complete installation and in libol there is a file called pkt_buffer.c which use to collect the kernel message and put into buffer.
In syslog-ng folder there is a Makefile which combine but libol and syslog-ng to compile the complete package .
For compilation of mysql porgram we need to provide library path -L/usr/lib/mysql -lmysqlclient -lz , and i have provide that path in Makefile of syslog -ng and libol but its gives same error ;

ERROR ;
gcc -g -O2 -Wall -I/usr/local/include/libol -D_GNU_SOURCE -o syslog-ng main.o sources.o center.o filters.o destinations.o log.o cfgfile.o cfg-grammar.o cfg-lex.o affile.o afsocket.o afunix.o afinet.o afinter.o afuser.o afstreams.o afprogram.o afremctrl.o nscache.o utils.o syslog-names.o macros.o -lrt -lnsl -lresolv /usr/local/lib/libol.a -lnsl -Wl,-Bstatic -lfl -Wl,-Bdynamic
/usr/local/lib/libol.a(pkt_buffer.o)(.text+0x229): In function `do_flush':
/usr/local/src/syslog-ng/libol-0.3.16/src/pkt_buffer.c:121: undefined reference to `mysql_init'
/usr/local/lib/libol.a(pkt_buffer.o)(.text+0x25a):/usr/local/src/syslog-ng/libol-0.3.16/src/pkt_buffer.c:127: undefined reference to `mysql_real_connect'
/usr/local/lib/libol.a(pkt_buffer.o)(.text+0x285):/usr/local/src/syslog-ng/libol-0.3.16/src/pkt_buffer.c:129: undefined reference to `mysql_query'
/usr/local/lib/libol.a(pkt_buffer.o)(.text+0x2a5):/usr/local/src/syslog-ng/libol-0.3.16/src/pkt_buffer.c:131: undefined reference to `mysql_affected_rows'
/usr/local/lib/libol.a(pkt_buffer.o)(.text+0x393):/usr/local/src/syslog-ng/libol-0.3.16/src/pkt_buffer.c:133: undef

Can anyone provide me a solution regarding this issue

Tinkster 11-03-2007 02:06 PM

Did you try to dynamically link the mysql-stuff rather than
statically?



Cheers,
Tink

raiux 11-04-2007 05:02 AM

i am knew to this field , that why i dont kown how to provide the dynamic and static link .....
but i think so i have provide the dynamic link in the Makefile of syslog-ng/src directory ......
thanx for reply since i am looking for solution for past 2 days .......


All times are GMT -5. The time now is 08:59 PM.