maciek134 / charge-guru

An application to control SkyRC B6* series chargers.
GNU General Public License v3.0
26 stars 8 forks source link

Unable To compile on POP OS( Ubuntu Based) #4

Closed abhaysv closed 2 years ago

abhaysv commented 2 years ago
[ 20%] Automatic MOC and UIC for target ChargeGuru
[ 20%] Built target ChargeGuru_autogen
[ 40%] Linking CXX executable ChargeGuru
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::~Device()':
Device.cc:(.text+0x14): undefined reference to `libusb_release_interface'
/usr/bin/ld: Device.cc:(.text+0x23): undefined reference to `libusb_close'
/usr/bin/ld: Device.cc:(.text+0x2f): undefined reference to `libusb_exit'
/usr/bin/ld: Device.cc:(.text+0x57): undefined reference to `libusb_attach_kernel_driver'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::m_read()':
Device.cc:(.text+0xdc): undefined reference to `libusb_interrupt_transfer'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::m_write(b6::Packet)':
Device.cc:(.text+0x1ae): undefined reference to `libusb_interrupt_transfer'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::m_sendCommand(b6::CMD)':
Device.cc:(.text+0x289): undefined reference to `libusb_interrupt_transfer'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::Device()':
Device.cc:(.text+0xcf5): undefined reference to `libusb_init'
/usr/bin/ld: Device.cc:(.text+0xd0f): undefined reference to `libusb_open_device_with_vid_pid'
/usr/bin/ld: Device.cc:(.text+0xd26): undefined reference to `libusb_kernel_driver_active'
/usr/bin/ld: Device.cc:(.text+0xd36): undefined reference to `libusb_claim_interface'
/usr/bin/ld: Device.cc:(.text+0xd77): undefined reference to `libusb_detach_kernel_driver'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::setBuzzers(bool, bool)':
Device.cc:(.text+0xe86): undefined reference to `libusb_interrupt_transfer'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::setCycleTime(int)':
Device.cc:(.text+0x103a): undefined reference to `libusb_interrupt_transfer'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::setTempLimit(int)':
Device.cc:(.text+0x11ca): undefined reference to `libusb_interrupt_transfer'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::setCapacityLimit(bool, int)':
Device.cc:(.text+0x139f): undefined reference to `libusb_interrupt_transfer'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o): in function `b6::Device::setTimeLimit(bool, int)':
Device.cc:(.text+0x15af): undefined reference to `libusb_interrupt_transfer'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/11/../../../../lib/libb6.a(Device.cc.o):Device.cc:(.text+0x1a2c): more undefined references to `libusb_interrupt_transfer' follow
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/ChargeGuru.dir/build.make:134: ChargeGuru] Error 1
make[1]: *** [CMakeFiles/Makefile2:84: CMakeFiles/ChargeGuru.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
abhaysv commented 2 years ago

Cmake gives the following output it seems the libusb is detected still this issue.

CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:44 (message):
  qt5_use_modules is not part of the official API, and might be removed in Qt
  6.
Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/Qt5Core/Qt5CoreMacros.cmake:431 (_qt5_warn_deprecated)
  CMakeLists.txt:25 (qt5_use_modules)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found libusb-1.0:
--  - Includes: /usr/include/libusb-1.0
--  - Libraries: /usr/lib/x86_64-linux-gnu/libusb-1.0.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/abhaysv/Desktop/GitHub/Cell-Characterization-IMAXB6-development/build

k

abhaysv commented 2 years ago

I used the CMAKE File Mentioned here this seems to work for me.

https://github.com/maciek134/charge-guru/issues/2

maciek134 commented 2 years ago

Hey, thanks for the report, this project has been kind of left alone for a while - it's been one of my first Qt projects and it shows.

A complete refactor/rewrite is in the works, should be ready in near future - will make the whole thing more maintainable and easier to work on (not sure what I was thinking with just a big cpp file with everything in it :D)