Darryl Ross
2004-Apr-29 10:32 UTC
[Asterisk-Users] spandsp compile error: PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared here
Hey All, I'm having a bit of a problem trying to get spandsp working on my asterisk machine. The machine is a Redhat 9.0 install with the latest version of libtiff and libtiff-devel (according to freshrpms.net). I manaaged to download, compile and successfully install the actual spandsp package with no errors. The problem comes when I try to compile the rxfax and txfax asterisk applications. The compile fails with the following error message: --------------------------- make[1]: Entering directory `/usr/src/asterisk/apps' gcc -O2 -g -Iinclude -I../include -c -o app_rxfax.o app_rxfax.c app_rxfax.c:45: `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared here (not in a function) make[1]: *** [app_rxfax.o] Error 1 make[1]: Leaving directory `/usr/src/asterisk/apps' make: *** [subdirs] Error 1 --------------------------- I've tried searching Google for that error, and I get a few things back that are not asterisk related, so it looks like the problem might lie elsewhere. I've also read through the source code, tracing the header files and such, and as far as I can work out it should be working. Mind you, I haven't done any C coding for about 6 years so I'm a little rusty. Line 45 of app_rcfax.c is "LOCAL_USER_DECL;", which is defined in /usr/include/asterisk/module.h. It includes AST_MUTEX_INITIALIZER, which is defined in /usr/include/asterisk/lock.h. The definition there includes PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP which is defined as a constant in /usr/include/pthread.h. It would seem for some reason that it's not being expanded properly by the preparser. Does anyone have any ideas how to fix it? As mentioned above, this is on a RH9 machine. TIA Darryl
Chris A. Icide
2004-Apr-29 10:57 UTC
[Asterisk-Users] spandsp compile error: PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared here
From a previous message on this list: if you want to compile app_rxfax and app_txfax with last cvsses of asterisk you have to modify the patched versions of the apps directory Makefile to define the symbol _GNU_SOURCE example, the line to compile app_rxfax from: gcc -O2 -g -Iinclude -I../include -c -o app_rxfax.o app_rxfax.c to gcc -D_GNU_SOURCE -O2 -g -Iinclude -I../include -c -o app_rxfax.o app_rxfax.c On 10:32 AM 4/29/2004, Darryl Ross wrote: >Hey All, > <snip> >--------------------------- > >make[1]: Entering directory `/usr/src/asterisk/apps' >gcc -O2 -g -Iinclude -I../include -c -o app_rxfax.o app_rxfax.c >app_rxfax.c:45: `PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared here >(not in a function) >make[1]: *** [app_rxfax.o] Error 1 >make[1]: Leaving directory `/usr/src/asterisk/apps' >make: *** [subdirs] Error 1 > >---------------------------
Stephen Davies
2004-Apr-29 12:39 UTC
[Asterisk-Users] spandsp compile error: PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP' undeclared here
On Fri, 30 Apr 2004, Darryl Ross wrote:> Hey All, > > I'm having a bit of a problem trying to get spandsp working on my > asterisk machine. The machine is a Redhat 9.0 install with the latest > version of libtiff and libtiff-devel (according to freshrpms.net). > > I manaaged to download, compile and successfully install the actual > spandsp package with no errors. The problem comes when I try to compile > the rxfax and txfax asterisk applications. The compile fails with the > following error message:Hi, IIRC, I had to add "#define _GNU_SOURCE" in Asterisk's lock.h before the includes at the top. Steve