pthread

I wrote a very small program to find out more about pthread's but the program doesn't want to link. I do have the pthread.h header file in the /usr/include directory and compiling works fine, but when gcc starts linking it says : undefinded reference to 'pthread_create'. What's wrong? Which rpm (I'm using RedHat) did I forgot to install this time?
LVL 1
940961slAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
bcolemanConnect With a Mentor Commented:
You need to pass gcc the library pthread.  For example:

gcc test.c -o test -lpthread

Hope this helps!!!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.