Public paste
Undefined
By: Guest | Date: Aug 20 2020 20:21 | Format: None | Expires: never | Size: 2.92 KB | Hits: 752

  1. Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
  2. Change Dir: /home/andre/SOURCES/gr-iridium/build/CMakeFiles/CMakeTmp
  3.  
  4. Run Build Command(s):/usr/bin/gmake cmTC_3c653/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_3c653.dir/build.make CMakeFiles/cmTC_3c653.dir/build
  5. gmake[1]: Entering directory '/home/andre/SOURCES/gr-iridium/build/CMakeFiles/CMakeTmp'
  6. Building C object CMakeFiles/cmTC_3c653.dir/src.c.o
  7. /usr/bin/cc   -DCMAKE_HAVE_LIBC_PTHREAD   -std=gnu11 -o CMakeFiles/cmTC_3c653.dir/src.c.o   -c /home/andre/SOURCES/gr-iridium/build/CMakeFiles/CMakeTmp/src.c
  8. Linking C executable cmTC_3c653
  9. /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_3c653.dir/link.txt --verbose=1
  10. /usr/bin/cc  -DCMAKE_HAVE_LIBC_PTHREAD    CMakeFiles/cmTC_3c653.dir/src.c.o  -o cmTC_3c653
  11. /usr/bin/ld: CMakeFiles/cmTC_3c653.dir/src.c.o: in function `main':
  12. src.c:(.text+0x2b): undefined reference to `pthread_create'
  13. /usr/bin/ld: src.c:(.text+0x34): undefined reference to `pthread_detach'
  14. /usr/bin/ld: src.c:(.text+0x3d): undefined reference to `pthread_cancel'
  15. /usr/bin/ld: src.c:(.text+0x4b): undefined reference to `pthread_join'
  16. collect2: error: ld returned 1 exit status
  17. gmake[1]: *** [CMakeFiles/cmTC_3c653.dir/build.make:107: cmTC_3c653] Error 1
  18. gmake[1]: Leaving directory '/home/andre/SOURCES/gr-iridium/build/CMakeFiles/CMakeTmp'
  19. gmake: *** [Makefile:141: cmTC_3c653/fast] Error 2
  20.  
  21.  
  22. Source file was:
  23. #include <pthread.h>
  24.  
  25. void* test_func(void* data)
  26. {
  27.   return data;
  28. }
  29.  
  30. int main(void)
  31. {
  32.   pthread_t thread;
  33.   pthread_create(&thread, NULL, test_func, NULL);
  34.   pthread_detach(thread);
  35.   pthread_cancel(thread);
  36.   pthread_join(thread, NULL);
  37.   pthread_atfork(NULL, NULL, NULL);
  38.   pthread_exit(NULL);
  39.  
  40.   return 0;
  41. }
  42.  
  43. Determining if the function pthread_create exists in the pthreads failed with the following output:
  44. Change Dir: /home/andre/SOURCES/gr-iridium/build/CMakeFiles/CMakeTmp
  45.  
  46. Run Build Command(s):/usr/bin/gmake cmTC_4955b/fast && /usr/bin/gmake  -f CMakeFiles/cmTC_4955b.dir/build.make CMakeFiles/cmTC_4955b.dir/build
  47. gmake[1]: Entering directory '/home/andre/SOURCES/gr-iridium/build/CMakeFiles/CMakeTmp'
  48. Building C object CMakeFiles/cmTC_4955b.dir/CheckFunctionExists.c.o
  49. /usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -std=gnu11 -o CMakeFiles/cmTC_4955b.dir/CheckFunctionExists.c.o   -c /usr/share/cmake-3.17/Modules/CheckFunctionExists.c
  50. Linking C executable cmTC_4955b
  51. /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_4955b.dir/link.txt --verbose=1
  52. /usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    CMakeFiles/cmTC_4955b.dir/CheckFunctionExists.c.o  -o cmTC_4955b  -lpthreads
  53. /usr/bin/ld: cannot find -lpthreads
  54. collect2: error: ld returned 1 exit status
  55. gmake[1]: *** [CMakeFiles/cmTC_4955b.dir/build.make:107: cmTC_4955b] Error 1
  56. gmake[1]: Leaving directory '/home/andre/SOURCES/gr-iridium/build/CMakeFiles/CMakeTmp'
  57. gmake: *** [Makefile:141: cmTC_4955b/fast] Error 2
  58.  
  59.  
  60.  
  61.