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

pinecil-firmware-updater-1.3: undefined references to `libusb #18

Open
jvw1954 opened this issue Oct 11, 2021 · 7 comments
Open

pinecil-firmware-updater-1.3: undefined references to `libusb #18

jvw1954 opened this issue Oct 11, 2021 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@jvw1954
Copy link

jvw1954 commented Oct 11, 2021

jaap@jaap:~/src/pinecil-firmware-updater-1.3$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 11 (bullseye)
Release:        11
Codename:       bullseye
jaap@jaap:~/src/pinecil-firmware-updater-1.3$ make
g++ -Wl,-O1 -o pinecil_firmware_updater aboutdialog.o connectpinecildialog.o flashingthread.o main.o mainwindow.o qrc_resources.o moc_aboutdialog.o moc_connectpinecildialog.o moc_flashingthread.o moc_mainwindow.o   /usr/lib/x86_64-linux-gnu/libQt5Widgets.so /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Network.so /usr/lib/x86_64-linux-gnu/libQt5Core.so -lGL -lpthread
/usr/bin/ld: mainwindow.o: in function `MainWindow::updatePinecilStatus()':
mainwindow.cpp:(.text+0x17f9): undefined reference to `libusb_get_device_list'
/usr/bin/ld: mainwindow.cpp:(.text+0x1865): undefined reference to `libusb_get_device_descriptor'
/usr/bin/ld: mainwindow.cpp:(.text+0x188b): undefined reference to `libusb_open'
/usr/bin/ld: mainwindow.cpp:(.text+0x1a10): undefined reference to `libusb_close'
/usr/bin/ld: mainwindow.o: in function `MainWindow::initLibUsb()':
mainwindow.cpp:(.text+0x1af1): undefined reference to `libusb_init'
collect2: error: ld returned 1 exit status
make: *** [Makefile:170: pinecil_firmware_updater] Fout 1
jaap@jaap:~/src/pinecil-firmware-updater-1.3$
@gamelaster
Copy link
Member

sudo apt install libusb-dev

@jvw1954
Copy link
Author

jvw1954 commented Oct 17, 2021

sudo apt install libusb-dev

libusb-dev is already installed

jaap@jaap:~$ sudo apt install libusb-dev
[sudo] wachtwoord voor jaap: 
Pakketlijsten worden ingelezen... Klaar
Boom van vereisten wordt opgebouwd... Klaar
De statusinformatie wordt gelezen... Klaar 
libusb-dev is reeds de nieuwste versie (2:0.1.12-32).
0 opgewaardeerd, 0 nieuw geïnstalleerd, 0 te verwijderen en 0 niet opgewaardeerd.
jaap@jaap:~$ cd src
jaap@jaap:~/src$ cd p*
jaap@jaap:~/src/pinecil-firmware-updater-1.3$ make
g++ -Wl,-O1 -o pinecil_firmware_updater aboutdialog.o connectpinecildialog.o flashingthread.o main.o mainwindow.o qrc_resources.o moc_aboutdialog.o moc_connectpinecildialog.o moc_flashingthread.o moc_mainwindow.o   /usr/lib/x86_64-linux-gnu/libQt5Widgets.so /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Network.so /usr/lib/x86_64-linux-gnu/libQt5Core.so -lGL -lpthread   
/usr/bin/ld: mainwindow.o: in function `MainWindow::updatePinecilStatus()':
mainwindow.cpp:(.text+0x17f9): undefined reference to `libusb_get_device_list'
/usr/bin/ld: mainwindow.cpp:(.text+0x1865): undefined reference to `libusb_get_device_descriptor'
/usr/bin/ld: mainwindow.cpp:(.text+0x188b): undefined reference to `libusb_open'
/usr/bin/ld: mainwindow.cpp:(.text+0x1a10): undefined reference to `libusb_close'
/usr/bin/ld: mainwindow.o: in function `MainWindow::initLibUsb()':
mainwindow.cpp:(.text+0x1af1): undefined reference to `libusb_init'
collect2: error: ld returned 1 exit status
make: *** [Makefile:170: pinecil_firmware_updater] Fout 1
jaap@jaap:~/src/pinecil-firmware-updater-1.3

@jvw1954
Copy link
Author

jvw1954 commented Oct 17, 2021

Qmake Project Message: deps/libusb/lib ????

jaap@jaap:~/src/pinecil-firmware-updater-1.3$ qmake
Project MESSAGE: /home/jaap/src/pinecil-firmware-updater-1.3/deps/libusb/lib/
jaap@jaap:~/src/pinecil-firmware-updater-1.3$

@jvw1954
Copy link
Author

jvw1954 commented Oct 20, 2021

pkg-config: libusb is installed

jaap@jaap:~$ pkg-config --list-all
Qt5Concurrent       Qt5 Concurrent - Qt Concurrent module
Qt5Core             Qt5 Core - Qt Core module
Qt5DBus             Qt5 DBus - Qt DBus module
Qt5Gui              Qt5 Gui - Qt Gui module
Qt5Network          Qt5 Network - Qt Network module
Qt5NetworkAuth      Qt5 NetworkAuth - Qt NetworkAuth module
Qt5OpenGL           Qt5 OpenGL - Qt OpenGL module
Qt5OpenGLExtensions Qt5 OpenGLExtensions - Qt OpenGLExtensions module
Qt5PrintSupport     Qt5 PrintSupport - Qt PrintSupport module
Qt5SerialBus        Qt5 SerialBus - Qt SerialBus module
Qt5Sql              Qt5 Sql - Qt Sql module
Qt5Test             Qt5 Test - Qt Unit Testing Library
Qt5Widgets          Qt5 Widgets - Qt Widgets module
Qt5Xml              Qt5 Xml - Qt Xml module
adwaita-icon-theme  gnome-icon-theme - A collection of icons used as the basis for GNOME themes
applewmproto        AppleWMProto - AppleWM extension headers
bash-completion     bash-completion - programmable completion for the bash shell
bigreqsproto        BigReqsProto - BigReqs extension headers
compositeproto      CompositeExt - Composite extension headers
damageproto         DamageProto - Damage extension headers
dmxproto            DMXProto - DMX extension headers
dpmsproto           DPMSProto - DPMS extension headers
dri2proto           DRI2Proto - DRI2 extension headers
dri3proto           DRI3Proto - DRI3 extension headers
egl                 EGL - EGL library and headers
exiv2               exiv2 - Exif and IPTC metadata library and tools
expat               expat - expat XML parser
fixesproto          FixesProto - X Fixes extension headers
fontsproto          FontsProto - Fonts extension headers
fontutil            FontUtil - Font utilities dirs
geoclue-2.0         Geoclue - The Geoinformation Service
gl                  GL - Legacy OpenGL and GLX library and headers.
glproto             GLProto - GL extension headers
glu                 glu - Mesa OpenGL Utility library
glx                 GLX - GLX library and headers.
gnome-icon-theme    gnome-icon-theme - A collection of icons used as the basis for GNOME themes
inputproto          InputProto - Input extension headers
iso-codes           iso-codes - ISO country, language, script and currency codes and translations
kbproto             KBProto - KB extension headers
libcrypt            libxcrypt - Extended crypt library for DES, MD5, Blowfish and others
libffi              libffi - Library supporting Foreign Function Interfaces
libgdiplus          libgdiplus - GDI+ implementation
libnsl              libnsl - Library containing NIS functions using TI-RPC (IPv6 enabled)
libtirpc            libtirpc - Transport Independent RPC Library
### ### libusb              libusb - USB access library
libusb-1.0          libusb-1.0 - C API for USB device access from Linux, Mac OS X, Windows, OpenBSD/NetBSD and Solaris userspace
libxcrypt           libxcrypt - Extended crypt library for DES, MD5, Blowfish and others
mozjs-78            SpiderMonkey 78.4.0 - The Mozilla library for JavaScript
poppler-data        poppler-data - Encoding files for use with poppler
presentproto        PresentProto - Present extension headers
pthread-stubs       pthread stubs - Meta package for pthread symbols - defaults to heavyweight ones if the C runtime does not provide lightweight ones.
python-3.9          Python - Build a C extension for Python
python-3.9-embed    Python - Embed Python into an application
python3             Python - Build a C extension for Python
python3-embed       Python - Embed Python into an application
randrproto          RandrProto - Randr extension headers
recordproto         RecordProto - Record extension headers
renderproto         RenderProto - Render extension headers
resourceproto       ResourceProto - Resource extension headers
scrnsaverproto      ScrnSaverProto - ScrnSaver extension headers
shared-mime-info    shared-mime-info - Freedesktop common MIME database
systemd             systemd - systemd System and Service Manager
udev                udev - udev
videoproto          VideoProto - Video extension headers
vulkan              Vulkan-Loader - Vulkan Loader
x11                 X11 - X Library
xau                 Xau - X authorization file management libary
xbitmaps            X bitmaps - Bitmaps that are shared between X applications
xcb                 XCB - X-protocol C Binding
xcmiscproto         XCMiscProto - XCMisc extension headers
xdmcp               Xdmcp - X Display Manager Control Protocol library
xext                Xext - Misc X Extension Library
xextproto           XExtProto - XExt extension headers
xf86bigfontproto    XF86BigFontProto - XF86BigFont extension headers
xf86dgaproto        XF86DGAProto - XF86DGA extension headers
xf86driproto        XF86DRIProto - XF86DRI extension headers
xf86vidmodeproto    XF86VidModeProto - XF86VidMode extension headers
xineramaproto       XineramaProto - Xinerama extension headers
xkbcomp             xkbcomp - XKB keymap compiler
xkeyboard-config    XKeyboardConfig - X Keyboard configuration data
xorg-sgml-doctools  xorg-sgml-doctools - Stylesheets and entities for X.Org documentation
xorg-wacom          xorg-wacom - X.Org Wacom Tablet driver.
xproto              Xproto - Xproto headers
xtrans              XTrans - Abstract network code for X
yelp-xsl            yelp-xsl - Yelp XSLT Stylesheets
zlib                zlib - zlib compression library
jaap@jaap:~$

@gamelaster
Copy link
Member

ln -s /usr/bin/dfu-util .

@jvw1954
Copy link
Author

jvw1954 commented Nov 1, 2021

ln -s /usr/bin/dfu-util

jaap@jaap:~$ cd src
jaap@jaap:~/src$ ls
pinecil-firmware-updater-1.3
jaap@jaap:~/src$ cd p*
jaap@jaap:~/src/pinecil-firmware-updater-1.3$ ln -s /usr/bin/dfu-util
jaap@jaap:~/src/pinecil-firmware-updater-1.3$ ls
aboutdialog.cpp           flashingthread.h  moc_aboutdialog.cpp                pinecil_firmware_updater.pro
aboutdialog.h             flashingthread.o  moc_aboutdialog.o                  pinecil_flashing.png
aboutdialog.o             LICENSE           moc_connectpinecildialog.cpp       qrc_resources.cpp
aboutdialog.ui            main.cpp          moc_connectpinecildialog.o         qrc_resources.o
connectpinecildialog.cpp  main.o            moc_flashingthread.cpp             README.md
connectpinecildialog.h    mainwindow.cpp    moc_flashingthread.o               resources.qrc
connectpinecildialog.o    mainwindow.h      moc_mainwindow.cpp                 ui_aboutdialog.h
connectpinecildialog.ui   mainwindow.o      moc_mainwindow.o                   ui_connectpinecildialog.h
dfu-util                  mainwindow.ui     moc_predefs.h                      ui_mainwindow.h
flashingthread.cpp        Makefile          pinecil_firmware_updater_en_US.ts
jaap@jaap:~/src/pinecil-firmware-updater-1.3$ make
^[[Ag++ -Wl,-O1 -o pinecil_firmware_updater aboutdialog.o connectpinecildialog.o flashingthread.o main.o mainwindow.o qrc_resources.o moc_aboutdialog.o moc_connectpinecildialog.o moc_flashingthread.o moc_mainwindow.o   /usr/lib/x86_64-linux-gnu/libQt5Widgets.so /usr/lib/x86_64-linux-gnu/libQt5Gui.so /usr/lib/x86_64-linux-gnu/libQt5Network.so /usr/lib/x86_64-linux-gnu/libQt5Core.so -lGL /usr/lib/x86_64-linux-gnu/libusb.so /usr/lib/x86_64-linux-gnu/libusb.a -lpthread
/usr/bin/ld: mainwindow.o: in function `MainWindow::updatePinecilStatus()':
mainwindow.cpp:(.text+0x17f9): undefined reference to `libusb_get_device_list'
/usr/bin/ld: mainwindow.cpp:(.text+0x1865): undefined reference to `libusb_get_device_descriptor'
/usr/bin/ld: mainwindow.cpp:(.text+0x188b): undefined reference to `libusb_open'
/usr/bin/ld: mainwindow.cpp:(.text+0x1a10): undefined reference to `libusb_close'
/usr/bin/ld: mainwindow.o: in function `MainWindow::initLibUsb()':
mainwindow.cpp:(.text+0x1af1): undefined reference to `libusb_init'
collect2: error: ld returned 1 exit status
make: *** [Makefile:171: pinecil_firmware_updater] Fout 1
jaap@jaap:~/src/pinecil-firmware-updater-1.3$

@tormodvolden
Copy link
Contributor

tormodvolden commented Jan 6, 2022

Did you figure this out? What does pkg-config --libs libusb-1.0 say? On Ubuntu 20.04 it gives -lusb-1.0 (also seen in the g++ command line) and it works fine.

The output from qmake -d 2>&1 | grep usb- can be useful too.

BTW, soft-linking to dfu-util is useless for this purpose.

@gamelaster gamelaster self-assigned this Feb 10, 2022
@gamelaster gamelaster added the bug Something isn't working label Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants