>Use the following to compile and run the program on the Solaris platform:>bash-3.00$ cc simplepthread.c -o simplepthread
>bash-3.00$ ./simplepthread
>main thread id = 1
>new thread id = 2
>bash-3.00$
> Using gcc on the Solaris platform gives the same results.
> On Linux it appears thus:
>max@linux:~/source> cc simplepthread.c
>/tmp/cc8u7kZs.o(.text+0x1e): In function `main':
>simplepthread.c: undefined reference to `pthread_create'
>/tmp/cc8u7kZs.o(.text+0x4a):simplepthread.c: undefined reference
> to `pthread_join'
>collect2: ld returned 1 exit status
>max@linux:~/source> cc simplepthread.c -lpthread -o simplepthread
>max@linux:~/source> ./simplepthread
>main thread id = 4015c6c0
>new thread id = 4035cbb0
>max@linux:~/source>
Ну что сказать...., у тех кто работает в Solaris обычно мозгов поменьше,
и не хватает ума подключть -lpthread, и за них это уже продумали в Sun,
знали с кем работать будут. :)