If:
/Usr/lib/libpthread. A (pthread_create.o) | in function 'pthread _ create': |
(. Text + 0xa2f) | undefined reference to '_ dl_stack_flags' |
/Usr/lib/libpthread. A (pthread_create.o) | in function 'pthread _ create': |
(. Text + 0xbe5) | undefined reference to '_ dl_stack_flags' |
/Usr/lib/libpthread. A (ptw-pause.o) | in function '_ pause_nocancel': |
(. Text + 0x18) | undefined reference to '_ syscall_error' |
/Usr/lib/libpthread. A (ptw-pause.o) | in function '_ pause_nocancel': |
Solution:
Add libpthread. A to the codeblocks linker settings and find the file in/usr/lib.
The-lpthread parameter must be added to the command line compilation.
GCC thread. C-o thread-lpthread
Thread. C is your source file. Do not forget to add the header file # include <pthread. h>
----------------------------------------------
If
/Usr/lib/libpthread. A (pthread_create.o): In function 'allocate _ stack ':
/Build/buildd/glibc-2.6.1/build-tree/glibc-2.6.1/nptl/allocatestack. C: 411: Undefined reference to '_ dl_stack_flags'
/Build/buildd/glibc-2.6.1/build-tree/glibc-2.6.1/nptl/allocatestack. C: 547: Undefined reference to '_ dl_stack_flags'
Add libc. A to the codeblocks linker settings and find the file in/usr/lib.