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 function
ast_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 function
MYSQL_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 of
unload_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 for
load_module’
/usr/include/asterisk/module.h:46: error: previous declaration of load_module' app_addon_sql_mysql.c:432: error: conflicting types for
description’
/usr/include/asterisk/module.h:75: error: previous declaration of description' app_addon_sql_mysql.c:437: error: conflicting types for
key’
/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!