Forum Discussion
Altera_Forum
Honored Contributor
21 years agoHi,
I thought your problem was not related to pthreads (the last example you passed to me had all pthread stuff commented out). If you want to use pthread, your previous Makefile is not enough. You need to tell the linker to link the pthread library, and it must appear before the C library, otherwise the dummies in C library will be linked in. Please add the following line to your Makefile: LDLIBS:=-lpthread $(LDLIBS) I tried your program several times, did not find any problems, and here is the output: <div class='quotetop'>QUOTE </div> --- Quote Start --- ################################## Will now allocate 8096 bytes ********************************** 8096 bytes allocated Will now create threads!!! 1! Thread One created!!! Thread 1 Thread 2 Thread 1 returns: 31916302 Thread 2 returns: 0[/b] --- Quote End --- wentao