gcc -pthread option for Linux

A

Avin

Hi,
I am using the Red Hat Linux 9.0 & gcc 3.2
I am trying to make multithreaded library from my c/c++ source code.

Do I have to use -pthread gcc option during compile time, or this
option is for HPUX only.

Thank you,
Avin Patel
 
C

Christopher Benson-Manica

J

Jerald Fijerald

Hi,
I am using the Red Hat Linux 9.0 & gcc 3.2
I am trying to make multithreaded library from my c/c++ source code.

Do I have to use -pthread gcc option during compile time, or this
option is for HPUX only.

I think you need -D_REENTRANT for one so libraries will use
reentrant versions of their code. Moreover you probably need
-lpthread, but you will understand that if the linker reports
undefined references to pthread_ functions.

Gerald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top