Advertisement
Guest User

Untitled

a guest
Jul 27th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <pthread.h>
  5.  
  6. void *function(){
  7.     while(1){
  8.         printf("hello world\n");
  9.     }
  10. }
  11.  
  12. int main(){
  13.     pthread_t thread_id;
  14.     pthread_create(&thread_id, NULL, function, NULL);
  15.     pthread_join(thread_id, NULL);
  16.     return 0;
  17.    
  18. }
  19.  
  20. error:
  21. /tmp/ccUxpahp.o: In function `main':
  22. segment.c:(.text+0x42): undefined reference to `pthread_create'
  23. segment.c:(.text+0x53): undefined reference to `pthread_join'
  24. collect2: error: ld returned 1 exit status
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement