Problem compiling asterisk-addons on debian sarge

I’m trying to compile/install asterisk in a debian sarge as described in this guide
http://powerontech.com/freepbx-on-debian.htm
I’ve successfully executed the steps before
"# build asterisk addons with mysql patch to makefile"
but when execute this step it returns some errors:


build asterisk addons with mysql patch to makefile

cd …/asterisk-addons
perl -p -i.bak -e ‘s/CFLAGS.*D_GNU_SOURCE/CFLAGS+=-D_GNU_SOURCE\nCFLAGS+=-DMYSQL_LOGUNIQUEID/’ Makefile
make clean; make install


make[1]: Entering directory /usr/src/asterisk-1.2/asterisk-addons' gcc -g -c -fPIC -fPIC -o app_addon_sql_mysql.o app_addon_sql_mysql.c app_addon_sql_mysql.c:15:22: asterisk.h: No such file or directory In file included from /usr/include/asterisk/linkedlists.h:23, from /usr/include/asterisk/chanvars.h:26, from /usr/include/asterisk/channel.h:111, from /usr/include/asterisk/file.h:30, from app_addon_sql_mysql.c:27: /usr/include/asterisk/lock.h: In functionast_mutex_init’:
/usr/include/asterisk/lock.h:534: error: PTHREAD_MUTEX_RECURSIVE' undeclared (first use in this function) /usr/include/asterisk/lock.h:534: error: (Each undeclared identifier is reported only once /usr/include/asterisk/lock.h:534: error: for each function it appears in.) app_addon_sql_mysql.c: In functionMYSQL_exec’:
app_addon_sql_mysql.c:390: error: dereferencing pointer to incomplete type
app_addon_sql_mysql.c:390: error: dereferencing pointer to incomplete type
app_addon_sql_mysql.c:390: error: dereferencing pointer to incomplete type
app_addon_sql_mysql.c:412: error: dereferencing pointer to incomplete type
app_addon_sql_mysql.c:412: error: dereferencing pointer to incomplete type
app_addon_sql_mysql.c:412: error: dereferencing pointer to incomplete type
app_addon_sql_mysql.c:412: error: dereferencing pointer to incomplete type
app_addon_sql_mysql.c: At top level:
app_addon_sql_mysql.c:419: error: conflicting types for unload_module' /usr/include/asterisk/module.h:57: error: previous declaration ofunload_module’
app_addon_sql_mysql.c: In function unload_module': app_addon_sql_mysql.c:420: error: dereferencing pointer to incomplete type app_addon_sql_mysql.c:420: error: dereferencing pointer to incomplete type app_addon_sql_mysql.c: At top level: app_addon_sql_mysql.c:425: error: conflicting types forload_module’
/usr/include/asterisk/module.h:46: error: previous declaration of load_module' app_addon_sql_mysql.c:432: error: conflicting types fordescription’
/usr/include/asterisk/module.h:75: error: previous declaration of description' app_addon_sql_mysql.c:437: error: conflicting types forkey’
/usr/include/asterisk/module.h:92: error: previous declaration of key' app_addon_sql_mysql.c:441: warning: data definition has no type or storage class make[1]: *** [app_addon_sql_mysql.o] Error 1 make[1]: Leaving directory/usr/src/asterisk-1.2/asterisk-addons’
make: *** [all] Error 2

what’s the problem and how can I solve it?

PS
Excuse me for my bad english!

most compilation errors for addons occur because the kernel-headers and/or the mysql-devel package (or headers and libs) aren’t available.

i’m not familiar with debian (nor particularly want to be), so can’t point you anywhere less generic than the MySQL download pages.

There is anyone that know the problem?

Thanks in advance

can you confirm that you’ve got either the mysql-devel package or the MySQL headers and libraries installed ?

I think yes but if you say me which dependency are necessary I will be sure!!! :smiley:

Thanks