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

Issue with libusb 1.0.22 / function 'libusb_set_debug' is deprecated #703

Closed
LeisureLadi opened this issue Apr 1, 2018 · 3 comments · Fixed by #704
Closed

Issue with libusb 1.0.22 / function 'libusb_set_debug' is deprecated #703

LeisureLadi opened this issue Apr 1, 2018 · 3 comments · Fixed by #704

Comments

@LeisureLadi
Copy link

Compiling stlink with 'make release' and 'make debug' with libusb 1.0.22 currently throws these warning messages:

...
Scanning dependencies of target stlink
[ 3%] Building C object CMakeFiles/stlink.dir/src/chipid.c.o
[ 6%] Building C object CMakeFiles/stlink.dir/src/common.c.o
[ 10%] Building C object CMakeFiles/stlink.dir/src/usb.c.o
[ 13%] Building C object CMakeFiles/stlink.dir/src/sg.c.o
/home/pi/stlink/src/sg.c: In function ‘stlink_open’:
/home/pi/stlink/src/sg.c:957:5: warning: ‘libusb_set_debug’ is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations]
libusb_set_debug(slsg->libusb_ctx, 3);
^~~~~~~~~~~~~~~~
In file included from /home/pi/stlink/include/stlink/sg.h:17:0,
from /home/pi/stlink/include/stlink.h:229,
from /home/pi/stlink/src/sg.c:85:
/usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
^~~~~~~~~~~~~~~~
...
Scanning dependencies of target stlink-static
[ 43%] Building C object CMakeFiles/stlink-static.dir/src/chipid.c.o
[ 46%] Building C object CMakeFiles/stlink-static.dir/src/common.c.o
[ 50%] Building C object CMakeFiles/stlink-static.dir/src/usb.c.o
[ 53%] Building C object CMakeFiles/stlink-static.dir/src/sg.c.o
/home/pi/stlink/src/sg.c: In function ‘stlink_open’:
/home/pi/stlink/src/sg.c:957:5: warning: ‘libusb_cc1: all warnings being treated as errors
CMakeFiles/stlink.dir/build.make:134: die Regel für Ziel „CMakeFiles/stlink.dir/src/sg.c.o“ scheiterte
make[3]: *** [CMakeFiles/stlink.dir/src/sg.c.o] Fehler 1
CMakeFiles/Makefile2:141: die Regel für Ziel „CMakeFiles/stlink.dir/all“ scheiterte
make[2]: *** [CMakeFiles/stlink.dir/all] Fehler 2
Makefile:149: die Regel für Ziel „all“ scheiterte
make[1]: *** [all] Fehler 2
Makefile:27: die Regel für Ziel „release“ scheiterte
make: *** [release] Fehler 2
_debug’ is deprecated: Use libusb_set_option instead [-Wdeprecated-declarations]
libusb_set_debug(slsg->libusb_ctx, 3);
^~~~~~~~~~~~~~~~
In file included from /home/pi/stlink/include/stlink/sg.h:17:0,
from /home/pi/stlink/include/stlink.h:229,
from /home/pi/stlink/src/sg.c:85:
/usr/include/libusb-1.0/libusb.h:1300:18: note: declared here
void LIBUSB_CALL libusb_set_debug(libusb_context *ctx, int level);
^~~~~~~~~~~~~~~~

Should I revert back to earlier releases of libusb and if so which one?

Thank you,

slyshykO added a commit to slyshykO/stlink that referenced this issue Apr 1, 2018
@slyshykO
Copy link
Collaborator

slyshykO commented Apr 1, 2018

Hi @LeisureLadi .
I've added PR with a fix. Please check it.

@LeisureLadi
Copy link
Author

Problem solved! Compiles now without errors. Great.

However, 'libstlink.so.1' was missing initially. I'm not sure, if the libraries are correctly saved in '/usr/local/lib/lib'. I changed the directory name to '/usr/local/lib/stlink' and added this path to '/etc/ld.so.conf.d/libc.conf'. After running 'sudo ldconfig', all is fine now.

Thanks a lot for the quick reply!
Happy Easter!

@xor-gate
Copy link
Member

xor-gate commented Apr 1, 2018

Thanks guys for catching up

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

Successfully merging a pull request may close this issue.

4 participants