Skip to content
Snippets Groups Projects
Select Git revision
  • 58eab668011ebe8d9813a176fd100d54ffd258fd
  • master default protected
2 results

CMakeError.log

Blame
  • CMakeError.log 3.50 KiB
    Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
    Change Dir: /home/sebastian/ros-workspaces/franka_teaching/panda_gazebo_workspace/src/panda_teaching/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make cmTC_6fb2b/fast && /usr/bin/make -f CMakeFiles/cmTC_6fb2b.dir/build.make CMakeFiles/cmTC_6fb2b.dir/build
    make[1]: Entering directory '/home/sebastian/ros-workspaces/franka_teaching/panda_gazebo_workspace/src/panda_teaching/cmake-build-debug/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_6fb2b.dir/src.c.o
    /usr/bin/cc   -DCMAKE_HAVE_LIBC_PTHREAD   -o CMakeFiles/cmTC_6fb2b.dir/src.c.o   -c /home/sebastian/ros-workspaces/franka_teaching/panda_gazebo_workspace/src/panda_teaching/cmake-build-debug/CMakeFiles/CMakeTmp/src.c
    Linking C executable cmTC_6fb2b
    /opt/clion-2019.3.4/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_6fb2b.dir/link.txt --verbose=1
    /usr/bin/cc  -DCMAKE_HAVE_LIBC_PTHREAD    -rdynamic CMakeFiles/cmTC_6fb2b.dir/src.c.o  -o cmTC_6fb2b 
    CMakeFiles/cmTC_6fb2b.dir/src.c.o: In function `main':
    src.c:(.text+0x3e): undefined reference to `pthread_create'
    src.c:(.text+0x4a): undefined reference to `pthread_detach'
    src.c:(.text+0x5b): undefined reference to `pthread_join'
    src.c:(.text+0x6f): undefined reference to `pthread_atfork'
    collect2: error: ld returned 1 exit status
    CMakeFiles/cmTC_6fb2b.dir/build.make:86: recipe for target 'cmTC_6fb2b' failed
    make[1]: *** [cmTC_6fb2b] Error 1
    make[1]: Leaving directory '/home/sebastian/ros-workspaces/franka_teaching/panda_gazebo_workspace/src/panda_teaching/cmake-build-debug/CMakeFiles/CMakeTmp'
    Makefile:121: recipe for target 'cmTC_6fb2b/fast' failed
    make: *** [cmTC_6fb2b/fast] Error 2
    
    
    Source file was:
    #include <pthread.h>
    
    void* test_func(void* data)
    {
      return data;
    }
    
    int main(void)
    {
      pthread_t thread;
      pthread_create(&thread, NULL, test_func, NULL);
      pthread_detach(thread);
      pthread_join(thread, NULL);
      pthread_atfork(NULL, NULL, NULL);
      pthread_exit(NULL);
    
      return 0;
    }
    
    Determining if the function pthread_create exists in the pthreads failed with the following output:
    Change Dir: /home/sebastian/ros-workspaces/franka_teaching/panda_gazebo_workspace/src/panda_teaching/cmake-build-debug/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/usr/bin/make cmTC_5ca8e/fast && /usr/bin/make -f CMakeFiles/cmTC_5ca8e.dir/build.make CMakeFiles/cmTC_5ca8e.dir/build
    make[1]: Entering directory '/home/sebastian/ros-workspaces/franka_teaching/panda_gazebo_workspace/src/panda_teaching/cmake-build-debug/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_5ca8e.dir/CheckFunctionExists.c.o
    /usr/bin/cc   -DCHECK_FUNCTION_EXISTS=pthread_create   -o CMakeFiles/cmTC_5ca8e.dir/CheckFunctionExists.c.o   -c /opt/clion-2019.3.4/bin/cmake/linux/share/cmake-3.15/Modules/CheckFunctionExists.c
    Linking C executable cmTC_5ca8e
    /opt/clion-2019.3.4/bin/cmake/linux/bin/cmake -E cmake_link_script CMakeFiles/cmTC_5ca8e.dir/link.txt --verbose=1
    /usr/bin/cc  -DCHECK_FUNCTION_EXISTS=pthread_create    -rdynamic CMakeFiles/cmTC_5ca8e.dir/CheckFunctionExists.c.o  -o cmTC_5ca8e -lpthreads 
    /usr/bin/ld: cannot find -lpthreads
    collect2: error: ld returned 1 exit status
    CMakeFiles/cmTC_5ca8e.dir/build.make:86: recipe for target 'cmTC_5ca8e' failed
    make[1]: *** [cmTC_5ca8e] Error 1
    make[1]: Leaving directory '/home/sebastian/ros-workspaces/franka_teaching/panda_gazebo_workspace/src/panda_teaching/cmake-build-debug/CMakeFiles/CMakeTmp'
    Makefile:121: recipe for target 'cmTC_5ca8e/fast' failed
    make: *** [cmTC_5ca8e/fast] Error 2