Following the latest * CVS update, my MySQL was broken. Following the update, Asterisk-addons would compile fine, but when I ran asterisk I got the following error: ERROR[1202489024]: cdr_addon_mysql.c:203 mysql_log: Failed to insert into databas I then tried using the patch (bug id 0001823) from bugs.digium.com, and found that Asterisk-addons would no longer compile, giving me the following errors: make clean ; make install rm -f *.so *.o .depend ./mkdep -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql `ls *.c` cc -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql -c -o cdr_addon_mysql.o cdr_addon_mysql.c cdr_addon_mysql.c:50: parse error before '!' token cdr_addon_mysql.c: In function `mysql_log': cdr_addon_mysql.c:110: `mysql_lock' undeclared (first use in this function) cdr_addon_mysql.c:110: (Each undeclared identifier is reported only once cdr_addon_mysql.c:110: for each function it appears in.) cdr_addon_mysql.c:121: `mysql' undeclared (first use in this function) cdr_addon_mysql.c: In function `my_unload_module': cdr_addon_mysql.c:226: `mysql' undeclared (first use in this function) cdr_addon_mysql.c: In function `my_load_module': cdr_addon_mysql.c:380: `mysql' undeclared (first use in this function) cdr_addon_mysql.c: In function `usecount': cdr_addon_mysql.c:422: `mysql_lock' undeclared (first use in this function) make: *** [cdr_addon_mysql.o] Error 1 I then tried using and older version of cdr_addon_mysql.c, and it also would not compile, but gave me an entirely different set of errors: ]# make clean ; make install rm -f *.so *.o .depend ./mkdep -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql `ls *.c` cc -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql -c -o cdr_addon_mysql.o cdr_addon_mysql.c cdr_addon_mysql.c:50: `__use_AST_MUTEX_DEFINE_STATIC_rather_than_AST_MUTEX_INITIALIZER__' undeclared here (not in a function) make: *** [cdr_addon_mysql.o] Error 1 I'm stuck on an MySQL project until I can resolve this problem. I've even blown away my system (OS as well as asterisk) and reloaded everything fresh from CVS, and still no joy. Any suggestions would be greatly appreciated.
Are you sure you are following instruction from the wiki correctly .. ? http://www.voip-info.org/wiki-Asterisk+cdr+mysql I recently updated it after I had simmillar issues. I think the steps outlined are quite clear now. Umar. -----Original Message----- From: asterisk-users-admin@lists.digium.com [mailto:asterisk-users-admin@lists.digium.com]On Behalf Of Ed Devine Sent: 11 June 2004 20:21 To: asterisk-users@lists.digium.com Subject: [Asterisk-Users] cdr_addon_mysql.c Following the latest * CVS update, my MySQL was broken. Following the update, Asterisk-addons would compile fine, but when I ran asterisk I got the following error: ERROR[1202489024]: cdr_addon_mysql.c:203 mysql_log: Failed to insert into databas I then tried using the patch (bug id 0001823) from bugs.digium.com, and found that Asterisk-addons would no longer compile, giving me the following errors: make clean ; make install rm -f *.so *.o .depend ../mkdep -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql `ls *.c` cc -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql -c -o cdr_addon_mysql.o cdr_addon_mysql.c cdr_addon_mysql.c:50: parse error before '!' token cdr_addon_mysql.c: In function `mysql_log': cdr_addon_mysql.c:110: `mysql_lock' undeclared (first use in this function) cdr_addon_mysql.c:110: (Each undeclared identifier is reported only once cdr_addon_mysql.c:110: for each function it appears in.) cdr_addon_mysql.c:121: `mysql' undeclared (first use in this function) cdr_addon_mysql.c: In function `my_unload_module': cdr_addon_mysql.c:226: `mysql' undeclared (first use in this function) cdr_addon_mysql.c: In function `my_load_module': cdr_addon_mysql.c:380: `mysql' undeclared (first use in this function) cdr_addon_mysql.c: In function `usecount': cdr_addon_mysql.c:422: `mysql_lock' undeclared (first use in this function) make: *** [cdr_addon_mysql.o] Error 1 I then tried using and older version of cdr_addon_mysql.c, and it also would not compile, but gave me an entirely different set of errors: ]# make clean ; make install rm -f *.so *.o .depend ../mkdep -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql `ls *.c` cc -fPIC -I../asterisk -D_GNU_SOURCE -I/usr/include/mysql -c -o cdr_addon_mysql.o cdr_addon_mysql.c cdr_addon_mysql.c:50: `__use_AST_MUTEX_DEFINE_STATIC_rather_than_AST_MUTEX_INITIALIZER__' undeclared here (not in a function) make: *** [cdr_addon_mysql.o] Error 1 I'm stuck on an MySQL project until I can resolve this problem. I've even blown away my system (OS as well as asterisk) and reloaded everything fresh from CVS, and still no joy. Any suggestions would be greatly appreciated. _______________________________________________ Asterisk-Users mailing list Asterisk-Users@lists.digium.com http://lists.digium.com/mailman/listinfo/asterisk-users To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Ed Devine wrote:>Following the latest * CVS update, my MySQL was broken. > >Following the update, Asterisk-addons would compile fine, but when I ran >asterisk I got the following error: > >ERROR[1202489024]: cdr_addon_mysql.c:203 mysql_log: Failed to insert >into databas > >I then tried using the patch (bug id 0001823) from bugs.digium.com, and >found that Asterisk-addons would no longer compile, giving me the >following errors: > >[...] I don't know, if it helps, but I also had some problems compiling cdr_addon_mysql.c, recently. To finally solve it that's what I did: 1) mkdir /tmp/A; cd /tmp/A 2) logged in to cvs 3) cvs checkout asterisk asterisk-addons 4) cd asterisk-addons 5) adjust the CFLAG section in the Makefile to look as follows: CFLAGS+=-fPIC CFLAGS+=-I../asterisk CFLAGS+=-I../asterisk/include CFLAGS+=-D_GNU_SOURCE 6) then run make --ca