Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undefined reference #34

Open
lemonL opened this issue Oct 19, 2017 · 2 comments
Open

Undefined reference #34

lemonL opened this issue Oct 19, 2017 · 2 comments

Comments

@lemonL
Copy link

lemonL commented Oct 19, 2017

/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_get_device_descriptor’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_init’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_detach_kernel_driver’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_open’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_get_device_list’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_exit’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_get_device’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_get_active_config_descriptor’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_bulk_transfer’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_free_device_list’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_claim_interface’未定义的引用
/home/kitty/Guidance-SDK-master/demo/catkin_ws/src/include/libDJI_guidance.so:对‘libusb_free_config_descriptor’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/dji_sdk_node.dir/build.make:519: recipe for target '/home/kitty/Guidance-SDK-master/demo/catkin_ws/devel/lib/dji_sdk/dji_sdk_node' failed
make[2]: *** [/home/kitty/Guidance-SDK-master/demo/catkin_ws/devel/lib/dji_sdk/dji_sdk_node] Error 1
CMakeFiles/Makefile2:707: recipe for target 'CMakeFiles/dji_sdk_node.dir/all' failed
make[1]: *** [CMakeFiles/dji_sdk_node.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j4 -l4" failed

@lemonL
Copy link
Author

lemonL commented Oct 19, 2017

CMakeError.log

Determining if the pthread_create exist failed with the following output:
Change Dir: /home/kitty/Guidance-SDK-master/demo/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_19694/fast"
/usr/bin/make -f CMakeFiles/cmTC_19694.dir/build.make CMakeFiles/cmTC_19694.dir/build
make[1]: Entering directory '/home/kitty/Guidance-SDK-master/demo/catkin_ws/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_19694.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_19694.dir/CheckSymbolExists.c.o -c /home/kitty/Guidance-SDK-master/demo/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_19694
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_19694.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_19694.dir/CheckSymbolExists.c.o -o cmTC_19694 -rdynamic
CMakeFiles/cmTC_19694.dir/CheckSymbolExists.c.o:在函数‘main’中:
CheckSymbolExists.c:(.text+0x16):对‘pthread_create’未定义的引用
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_19694.dir/build.make:97: recipe for target 'cmTC_19694' failed
make[1]: *** [cmTC_19694] Error 1
make[1]: Leaving directory '/home/kitty/Guidance-SDK-master/demo/catkin_ws/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_19694/fast' failed
make: *** [cmTC_19694/fast] Error 2

File /home/kitty/Guidance-SDK-master/demo/catkin_ws/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>

int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}

Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/kitty/Guidance-SDK-master/demo/catkin_ws/build/CMakeFiles/CMakeTmp

Run Build Command:"/usr/bin/make" "cmTC_71697/fast"
/usr/bin/make -f CMakeFiles/cmTC_71697.dir/build.make CMakeFiles/cmTC_71697.dir/build
make[1]: Entering directory '/home/kitty/Guidance-SDK-master/demo/catkin_ws/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_71697.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_71697.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_71697
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_71697.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_71697.dir/CheckFunctionExists.c.o -o cmTC_71697 -rdynamic -lpthreads
/usr/bin/ld: 找不到 -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_71697.dir/build.make:97: recipe for target 'cmTC_71697' failed
make[1]: *** [cmTC_71697] Error 1
make[1]: Leaving directory '/home/kitty/Guidance-SDK-master/demo/catkin_ws/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_71697/fast' failed
make: *** [cmTC_71697/fast] Error 2

@seanavery
Copy link

I am having this same issue @lemonL. Were you able to get around it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants