[erlang-questions] error compiling r13b04: /usr/include/nptl/pthread.h:658: error: array type has incomplete element type

Mikael Pettersson <>
Sat Mar 20 21:42:29 CET 2010

john blair writes:
 > I am building the latest release r13b04 on a lin64 machine (RHEL 3.8) with gcc-4.1.1 and get the following error:
 > gcc -DUSE_THREADS -D_THREAD_SAFE -D_REENTRANT -DPOSIX_THREADS -D_POSIX_THREAD_SAFE_FUNCTIONS -isystem /usr/include/nptl  -g -O3 -I/opt/src/erlang-otp-r13b04/otp_src_R13B04/erts/x86_64-unknown-linux-gnu   -I/opt/lin64/ncurses-5.5/include -D_GNU_SOURCE -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes -Wdeclaration-after-statement -DHAVE_CONFIG_H  -I../include -I../include/x86_64-unknown-linux-gnu -I../include/internal -I../include/internal/x86_64-unknown-linux-gnu -I../emulator/beam -I../emulator/sys/unix -c common/ethread.c -o obj/x86_64-unknown-linux-gnu/opt/r/ethread.o
 > In file included from ../include/internal/ethread.h:124,
 >                  from common/ethread.c:68:
 > /usr/include/nptl/pthread.h:658: error: array type has incomplete element type
 > make[5]: *** [obj/x86_64-unknown-linux-gnu/opt/r/ethread.o] Error 1
 > make[5]: Leaving directory `/opt/src/erlang-otp-r13b04/otp_src_R13B04/erts/lib_src'
 > make[4]: *** [opt] Error 2
 > make[4]: Leaving directory `/opt/src/erlang-otp-r13b04/otp_src_R13B04/erts/lib_src'
 > make[3]: *** [erts_lib] Error 2
 > make[3]: Leaving directory `/opt/src/erlang-otp-r13b04/otp_src_R13B04/erts/emulator'
 > make[2]: *** [opt] Error 2
 > make[2]: Leaving directory `/opt/src/erlang-otp-r13b04/otp_src_R13B04/erts/emulator'
 > make[1]: *** [smp] Error 2
 > make[1]: Leaving directory `/opt/src/erlang-otp-r13b04/otp_src_R13B04/erts'
 > make: *** [emulator] Error 2

This is your gcc complaining about your system's glibc headers.
This is not an Erlang bug.

The warning in question was common when gcc-4.1 was new, lots of
slightly broken code had to be repaired for it. But that was ages ago.

 > Anyone knows how to resolve this?

Use the system gcc (RHEL3 seems to use gcc-3.2.3) or update the entire system
to something less antique.

A self-compiled gcc-3.4.6 might work too.

More information about the erlang-questions mailing list