views:

88

answers:

1

I get undefined reference to `pthread_atfork' even after using pthread library. Is there any separate library for this?

+1  A: 

pthread_atfork() is part of the POSIX spec, so it should be there in the regular pthread library.

You may have to specify options to both the compiler & linker to build with pthreads. For example, with gcc/linux:

-pthread
       Adds support for multithreading with the pthreads library.  This option sets flags for both the
       preprocessor and linker.
David Gelhar