Re[2]: [Asterisk-bsd] cdr_mysql.c error on FreeBSD 5.2.1

Vitaly Apolonsky asterisk-bsd@lists.digium.com
Tue, 20 Jul 2004 00:16:30 +0300


Hello Dr.,

You are right, the problem was in the old version of lock.h
(asterisk-0.9.0)

Thanks.


Monday, July 19, 2004, 11:48:07 PM, you wrote:

DRM> This appears to be a problem with
DRM> asterisk/include/asterisk/lock.h.

DRM> Lock.h should #define the macro
DRM> AST_MUTEX_DEFINE_STATIC(lock), but the
DRM> compiler seems to think that it is a function rather than a macro.

DRM> Email me the output of 

DRM> cc -fPIC -I../asterisk -D_GNU_SOURCE  
DRM> -I/usr/local/include/mysql    -C -E
DRM> -dD cdr_addon_mysql.c  -o cdr_addon_mysql.txt

DRM> And perhaps I can help.  It may not be much consolation, but I just 'cvs
DRM> update'ed and compiled without seeing those error messages. If you haven't
DRM> updated asterisk (server) as well, perhaps that would help ensure that
DRM> lock.h is in sync.

DRM> Cheers,
DRM> Rich


DRM> gmake
DRM> ./mkdep -fPIC -I../asterisk -D_GNU_SOURCE  
DRM> -I/usr/local/include/mysql  `ls
DRM> *.c`
DRM> cc -fPIC -I../asterisk -D_GNU_SOURCE  
DRM> -I/usr/local/include/mysql    -c -o
DRM> cdr_addon_mysql.o cdr_addon_mysql.c
DRM> cdr_addon_mysql.c: In function `mysql_log':
DRM> cdr_addon_mysql.c:111: warning: passing arg 1 of `localtime_r' from
DRM> incompatible pointer type
DRM> cc -shared -Xlinker -x -o cdr_addon_mysql.so
DRM> cdr_addon_mysql.o -lmysqlclient
DRM> -lz    -L/usr/local/lib/mysql 

DRM> uname -a
DRM> FreeBSD xa.houston.rr.com 5.2.1-RC FreeBSD 5.2.1-RC #0: Mon Jun 14 18:18:35
DRM> CDT 2004
DRM> root@xa.houston.rr.com:/usr/a/altq-freebsd-5.2-release-beta2/sys/i386/compil
DRM> e/TEST  i386

DRM> /usr/local/bin/mysql -V
DRM> /usr/local/bin/mysql  Ver 11.18 Distrib 3.23.58, for portbld-freebsd5.2
DRM> (i386)


>> -----Original Message-----
>> From: asterisk-bsd-admin@lists.digium.com 
>> [mailto:asterisk-bsd-admin@lists.digium.com] On Behalf Of 
>> Vitaly Apolonsky
>> Sent: Monday, July 19, 2004 2:56 PM
>> To: asterisk-bsd@lists.digium.com
>> Subject: [Asterisk-bsd] cdr_mysql.c error on FreeBSD 5.2.1
>> 
>> 
>> 
>> asterisk# uname -a
>> FreeBSD asterisk 5.2.1-RELEASE FreeBSD 5.2.1-RELEASE #0: Sun 
>> Jun  6 22:09:46 GMT 2004     
>> root@:/usr/src/sys/i386/compile/asterisk  i386
>> 
>> 
>> cdr_addon_mysql.c 1.5 Fri Jul  9 16:24:28 2004
>> 
>> 
>> asterisk# gmake
>> ./mkdep -fPIC -I/usr/local/include -D_GNU_SOURCE   
>> -I/usr/local/include/mysql  `ls *.c`
>> cc -fPIC -I/usr/local/include -D_GNU_SOURCE   
>> -I/usr/local/include/mysql    -c -o cdr_addon_mysql.o 
>> cdr_addon_mysql.c
>> cdr_addon_mysql.c:50: warning: parameter names (without 
>> types) in function declaration
>> cdr_addon_mysql.c:50: warning: data definition has no type or 
>> storage class
>> cdr_addon_mysql.c: In function `mysql_log':
>> cdr_addon_mysql.c:107: error: `mysql_lock' undeclared (first 
>> use in this function)
>> cdr_addon_mysql.c:107: error: (Each undeclared identifier is 
>> reported only once
>> cdr_addon_mysql.c:107: error: for each function it appears in.)
>> cdr_addon_mysql.c:111: warning: passing arg 1 of 
>> `localtime_r' from incompatible pointer type
>> cdr_addon_mysql.c: In function `usecount':
>> cdr_addon_mysql.c:417: error: `mysql_lock' undeclared (first 
>> use in this function)
>> gmake: *** [cdr_addon_mysql.o] Error 1
>>   
>> asterisk#
>> 
>> Can anyone help ?
>> 
>> --
>> Best regards,
>>  Vitaly Apolonsky            mailto:apollo@nameserver.net.ua
>> 
>> _______________________________________________
>> Asterisk-BSD mailing list
>> Asterisk-BSD@lists.digium.com
>> http://lists.digium.com/mailman/listinfo/asterisk-bsd
>> 
>> 


DRM> _______________________________________________
DRM> Asterisk-BSD mailing list
DRM> Asterisk-BSD@lists.digium.com
DRM> http://lists.digium.com/mailman/listinfo/asterisk-bsd



-- 
Best regards,
 Vitaly                            mailto:apollo@nameserver.net.ua