Do I need -D_REENTRANT with -pthreads?

For me the best answer was the comment from pts if only he bothered to submit it as answer:

You investigated properly and answered
your own question. Use g++ -pthread,
it is equivalent to g++ -lpthread -D_REENTRANT.
Using g++ -D_REENTRANT would be different,
it may not set all the linker flags. –
pts May 18 at 0:30

Leave a Comment