Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Linking issue with libusb-1.0
Forum Updated to NodeBB v4.3 + New Features

Linking issue with libusb-1.0

Scheduled Pinned Locked Moved Solved 3rd Party Software
11 Posts 3 Posters 2.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kaluss
    wrote on last edited by
    #1

    Hi,
    I got problem with libusb-1.0:
    I got following configuration in my pro file:
    unix:!macx|win32: LIBS += -L$$PWD/Scale/lib/ -llibusb-1.0
    INCLUDEPATH += $$PWD/Scale/inc
    DEPENDPATH += $$PWD/Scale/inc

    But during build I get linking issue:
    error: undefined reference to `libusb_init'

    error: undefined reference to `libusb_kernel_driver_active'

    an so on..

    I would be grateful for any hints.

    jsulmJ 1 Reply Last reply
    0
    • K Kaluss

      Hi,
      I got problem with libusb-1.0:
      I got following configuration in my pro file:
      unix:!macx|win32: LIBS += -L$$PWD/Scale/lib/ -llibusb-1.0
      INCLUDEPATH += $$PWD/Scale/inc
      DEPENDPATH += $$PWD/Scale/inc

      But during build I get linking issue:
      error: undefined reference to `libusb_init'

      error: undefined reference to `libusb_kernel_driver_active'

      an so on..

      I would be grateful for any hints.

      jsulmJ Online
      jsulmJ Online
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @Kaluss said in Linking issue with libusb-1.0:

      -llibusb-1.0

      On UNIX/Linux this has to be:

      -lusb-1.0
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply
      2
      • jsulmJ jsulm

        @Kaluss said in Linking issue with libusb-1.0:

        -llibusb-1.0

        On UNIX/Linux this has to be:

        -lusb-1.0
        
        K Offline
        K Offline
        Kaluss
        wrote on last edited by
        #3

        @jsulm Forgot to add: It's on Windows 11

        JonBJ K 2 Replies Last reply
        0
        • K Kaluss

          @jsulm Forgot to add: It's on Windows 11

          JonBJ Online
          JonBJ Online
          JonB
          wrote on last edited by JonB
          #4

          @Kaluss
          Need to know whether you are using MSVC or MinGW then? If MinGW then as per Linux.

          However the error message may indicate that the .lib/.a library file was indeed found, but did not resolve the specified symbols. I have no idea whether this is supposed to be needed under Windows.

          K 1 Reply Last reply
          0
          • K Kaluss

            @jsulm Forgot to add: It's on Windows 11

            K Offline
            K Offline
            Kaluss
            wrote on last edited by
            #5

            @Kaluss In addition. It was working on Qt 5, but when I upgraded to latest version it's started to throw those errors.

            1 Reply Last reply
            0
            • JonBJ JonB

              @Kaluss
              Need to know whether you are using MSVC or MinGW then? If MinGW then as per Linux.

              However the error message may indicate that the .lib/.a library file was indeed found, but did not resolve the specified symbols. I have no idea whether this is supposed to be needed under Windows.

              K Offline
              K Offline
              Kaluss
              wrote on last edited by Kaluss
              #6

              @JonB It's Qt_6_4_3_MinGW_64_bit, libusb-1.0.a, and it's needed to handle scale on Windows. And it was working on Qt 5 ... In some sources I found information that maybe linker flag is needed here.

              JonBJ 1 Reply Last reply
              0
              • K Kaluss

                @JonB It's Qt_6_4_3_MinGW_64_bit, libusb-1.0.a, and it's needed to handle scale on Windows. And it was working on Qt 5 ... In some sources I found information that maybe linker flag is needed here.

                JonBJ Online
                JonBJ Online
                JonB
                wrote on last edited by JonB
                #7

                @Kaluss
                If it's MinGW I would expect you to need to specify -lusb-1.0 not -llibusb-1.0, as @jsulm said.

                If that library was working with Qt5 but now generates "unresolved symbols" at Qt6 then things may have changed internally and you might need a different version of that library, I don't know.

                K 1 Reply Last reply
                0
                • JonBJ JonB

                  @Kaluss
                  If it's MinGW I would expect you to need to specify -lusb-1.0 not -llibusb-1.0, as @jsulm said.

                  If that library was working with Qt5 but now generates "unresolved symbols" at Qt6 then things may have changed internally and you might need a different version of that library, I don't know.

                  K Offline
                  K Offline
                  Kaluss
                  wrote on last edited by
                  #8

                  @JonB when I change to: -lusb-1.0

                  I got:
                  error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0
                  error: skipping incompatible ...\Scale\lib\libusb-1.0.a when searching for -lusb-1.0
                  error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0
                  error: cannot find -lusb-1.0
                  error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0
                  error: collect2.exe: error: ld returned 1 exit status

                  jsulmJ JonBJ 2 Replies Last reply
                  0
                  • K Kaluss

                    @JonB when I change to: -lusb-1.0

                    I got:
                    error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0
                    error: skipping incompatible ...\Scale\lib\libusb-1.0.a when searching for -lusb-1.0
                    error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0
                    error: cannot find -lusb-1.0
                    error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0
                    error: collect2.exe: error: ld returned 1 exit status

                    jsulmJ Online
                    jsulmJ Online
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @Kaluss said in Linking issue with libusb-1.0:

                    ...\Scale\lib/libusb-1.0.a

                    This is static library. Do you also have dynamic one (.so)?

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    0
                    • K Kaluss

                      @JonB when I change to: -lusb-1.0

                      I got:
                      error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0
                      error: skipping incompatible ...\Scale\lib\libusb-1.0.a when searching for -lusb-1.0
                      error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0
                      error: cannot find -lusb-1.0
                      error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0
                      error: collect2.exe: error: ld returned 1 exit status

                      JonBJ Online
                      JonBJ Online
                      JonB
                      wrote on last edited by
                      #10

                      @Kaluss said in Linking issue with libusb-1.0:

                      error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0

                      In addition to @jsulm. As you can see it has now found a matching libusb-1.0.a file and is rejecting it because it is "incompatible". Which is doubtless why you get "unresolved references". Different compiler? Different 32- vs 64-bitedness? Old version requiring a newer one?

                      K 1 Reply Last reply
                      1
                      • JonBJ JonB

                        @Kaluss said in Linking issue with libusb-1.0:

                        error: skipping incompatible ...\Scale\lib/libusb-1.0.a when searching for -lusb-1.0

                        In addition to @jsulm. As you can see it has now found a matching libusb-1.0.a file and is rejecting it because it is "incompatible". Which is doubtless why you get "unresolved references". Different compiler? Different 32- vs 64-bitedness? Old version requiring a newer one?

                        K Offline
                        K Offline
                        Kaluss
                        wrote on last edited by
                        #11

                        @JonB Exactly, downloaded libusb version for mingw 64 and now it's working.
                        Thank u guys for support.

                        1 Reply Last reply
                        0
                        • K Kaluss has marked this topic as solved on

                        • Login

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved