librealsense icon indicating copy to clipboard operation
librealsense copied to clipboard

error: 'libusb_get_port_number' was not declared

Open Kanelankai opened this issue 8 years ago • 3 comments

Hello! I am installing R200 in Ubuntu 14.04 Jetson TK1with Kernel 3.10.40. I noticed that in this article it uses libusb 1.0-0 but I have installed libusb 1.0-9 in my tk1 and it must be remained because other device needs this library. First I installed libusb 1.0-0, when I executed "make" it came up with the error "src/uvc-v4l2.cpp:402:72: error: 'libusb_get_port_number' was not declared in this scope std::to_string(libusb_get_port_number(device.usb_device)); ". I know that this was because two version of libusb was in my pc. So then I removed libusb 1.0-0 by "sudo apt-get purge" leaving only libusb 1.0-9 and executed "make", the same error occurred.

I asked other people, they tell me to change the include file paths of libusb. So I tried to change the include file paths by the makefile under the directory of librealsense. I changed the LIBUSB_FLAGS to "LIBUSB_FLAGS := -L/home/ubuntu/libusb-1.0.9/libusb/.libs -lusb-1.0 -I/home/ubuntu/libusb-1.0.9/libusb" because I installed libusb-1.0.9 here.

I confirmed the directory of libusb.h by executing $ :locate libusb.h Then the terminal showed: /home/ubuntu/libusb-1.0.9/libusb/libusb.h /usr/local/include/libusb-1.0/libusb.h

Also confirmed where the libusb-1.0.so is /home/ubuntu/libusb-1.0.9/libusb/.libs/libusb-1.0.so /opt/ros/indigo/lib/libusb_cam.so /usr/local/lib/libusb-1.0.so

However the same error occurred. I'm not very familiar with makefile, so could anyone please tell me where I should write the correct information to the makefile? Maybe not just the makefile should be changed.

Thank you very much!

Kanelankai avatar Jan 12 '18 04:01 Kanelankai

[Realsense Customer Engineering Team Comment] Hi Kanelankai

Did you use librealsense SDK 1.0 (the latest release: https://github.com/IntelRealSense/librealsense/tree/v1.12.1) for R200? Librealsense SDK 2.0 is for D400 series camera. When you use CMAKE tool to build the code, please check if the INCLUDE is set to "/usr/include/libusb-1.0". Normally, CMAKE tool should automatically check and finish the makefile configurations.

[Realsense Customer Engineering Team Comment] Hi @Kanelankai,

Any further help required?

Thank you very much! I have solved this problem. You can close it now.

Kanelankai avatar Mar 08 '18 05:03 Kanelankai