CMake Error at /opt/ros/melodic/share/genmsg/cmake/genmsg-extras.cmake:271 (message):
Could not find 'share/std_msgs/cmake/std_msgs-msg-paths.cmake' (searched in
'/home/mandy/ross/leg_tracker_ws/devel')
错误日志如下: /home/mandy/ross/leg_tracker_ws/build/CMakeFiles/CMakeError.log
(py36sarl) mandy@LAPTOP-U3AQMP8F:~/ross/leg_tracker_ws$ cat /home/mandy/ross/leg_tracker_ws/build/CMakeFiles/CMakeError.log
Performing C SOURCE FILE Test CMAKE_HAVE_LIBC_PTHREAD failed with the following output:
Change Dir: /home/mandy/ross/leg_tracker_ws/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_65fba/fast && /usr/bin/make -f CMakeFiles/cmTC_65fba.dir/build.make CMakeFiles/cmTC_65fba.dir/build
make[1]: Entering directory '/home/mandy/ross/leg_tracker_ws/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_65fba.dir/src.c.o
/usr/bin/cc -DCMAKE_HAVE_LIBC_PTHREAD -o CMakeFiles/cmTC_65fba.dir/src.c.o -c /home/mandy/ross/leg_tracker_ws/build/CMakeFiles/CMakeTmp/src.c
Linking C executable cmTC_65fba
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_65fba.dir/link.txt --verbose=1
/usr/bin/cc -rdynamic CMakeFiles/cmTC_65fba.dir/src.c.o -o cmTC_65fba
CMakeFiles/cmTC_65fba.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+0x56): undefined reference to `pthread_cancel'
src.c:(.text+0x67): undefined reference to `pthread_join'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_65fba.dir/build.make:98: recipe for target 'cmTC_65fba' failed
make[1]: *** [cmTC_65fba] Error 1
make[1]: Leaving directory '/home/mandy/ross/leg_tracker_ws/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_65fba/fast' failed
make: *** [cmTC_65fba/fast] Error 2
Source file was:
#include <pthread.h>
static void* test_func(void* data)
{
return data;
}
int main(void)
{
pthread_t thread;
pthread_create(&thread, NULL, test_func, NULL);
pthread_detach(thread);
pthread_cancel(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/mandy/ross/leg_tracker_ws/build/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/make -f Makefile cmTC_8c165/fast && /usr/bin/make -f CMakeFiles/cmTC_8c165.dir/build.make CMakeFiles/cmTC_8c165.dir/build
make[1]: Entering directory '/home/mandy/ross/leg_tracker_ws/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_8c165.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_8c165.dir/CheckFunctionExists.c.o -c /usr/local/share/cmake-3.21/Modules/CheckFunctionExists.c
Linking C executable cmTC_8c165
/usr/local/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8c165.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -rdynamic CMakeFiles/cmTC_8c165.dir/CheckFunctionExists.c.o -o cmTC_8c165 -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_8c165.dir/build.make:98: recipe for target 'cmTC_8c165' failed
make[1]: *** [cmTC_8c165] Error 1
make[1]: Leaving directory '/home/mandy/ross/leg_tracker_ws/build/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_8c165/fast' failed
make: *** [cmTC_8c165/fast] Error 2