Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <pthread.h>
- void *function(){
- while(1){
- printf("hello world\n");
- }
- }
- int main(){
- pthread_t thread_id;
- pthread_create(&thread_id, NULL, function, NULL);
- pthread_join(thread_id, NULL);
- return 0;
- }
- error:
- /tmp/ccUxpahp.o: In function `main':
- segment.c:(.text+0x42): undefined reference to `pthread_create'
- segment.c:(.text+0x53): undefined reference to `pthread_join'
- collect2: error: ld returned 1 exit status
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement