|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
Undefined reference to `pthread_create'
i made a program the error while compilation comes like:
undefined reference to `pthread_create' pls suggest. Last edited by dillidamunda : September 25th, 2006 at 09:42 PM. Reason: mismatch |
|
#3
|
||||
|
||||
|
Quote:
I believe it should be Quote:
|
|
#4
|
|||
|
|||
|
Code:
tux64-05:0:~/tmp > gcc t.c /tmp/ccKRLyw2.o: In function `main': t.c:(.text+0x45): undefined reference to `pthread_create' collect2: ld returned 1 exit status tux64-05:0:~/tmp > gcc -pthread t.c tux64-05:0:~/tmp > Either way. from man gcc Code:
-pthread
Adds support for multithreading with the pthreads library. This
option sets flags for both the preprocessor and linker.
|
|
#5
|
|||
|
|||
|
This might also be useful.
This is also platform dependent. you can use -pthread and -lpthread both. The only difference is that:
Compiler/Platform :PGI Linux Command is: pgcc -lpthread Compiler/Platform :GNU Linux, AIX Command is: gcc -pthread Cheers! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > Undefined reference to `pthread_create' |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|