Results 1 to 5 of 5

Thread: Problem with libusb in macOS high Sierra

  1. #1
    Join Date
    Jun 2018
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Problem with libusb in macOS high Sierra

    hi, I add libusb through "external library" and add the file libusb.h to the project folder and when I run one of the examples (listdevs.c) of this library I get the following problem. I understand it's a compatibility problem. Does anyone know how to fix this problem?

    ld: warning: ignoring file /Users/eduardo/My Cloud/Programas/dataMonitor 10 copy/libusb-1.0-2.22/MinGW64/static//libusb-1.0.a, file was built for archive which is not the architecture being linked (x86_64): /Users/eduardo/My Cloud/Programas/dataMonitor 10 copy/libusb-1.0-2.22/MinGW64/static//libusb-1.0.a
    Undefined symbols for architecture x86_64:
    "_libusb_get_bus_number", referenced from:
    configureGraph:rint_devs(libusb_device**) in configuregraph.o
    "_libusb_get_device_address", referenced from:
    configureGraph:rint_devs(libusb_device**) in configuregraph.o
    "_libusb_get_device_descriptor", referenced from:
    configureGraph:rint_devs(libusb_device**) in configuregraph.o
    "_libusb_get_port_numbers", referenced from:
    configureGraph:rint_devs(libusb_device**) in configuregraph.o
    ld: symbol(s) not found for architecture x86_64
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    make: *** [dataMonitor.app/Contents/MacOS/dataMonitor] Error 1
    22:35:33: The process "/usr/bin/make" exited with code 2.
    Error while building/deploying project dataMonitor (kit: Desktop Qt 5.11.1 clang 64bit)
    When executing step "Make"


    Does anyone know if there is a generic driver in macOS like the Microsoft winUSB for Qt?
    thanks for help me
    Last edited by Eduardo Huerta; 8th January 2019 at 05:38.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problem with libusb in macOS high Sierra

    Does anyone know how to fix this problem?
    You probably either need to get a 64-bit version of a compiled libusb-1.0.a or built it yourself from the source code using the same compiler tool chain you are using for your app.

    Changing to a different library won't help if it is built for the wrong architecture.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jun 2018
    Posts
    31
    Thanks
    8
    Qt products
    Qt5
    Platforms
    MacOS X Windows

    Default Re: Problem with libusb in macOS high Sierra

    Compile the libusb source code with my program and show an error similar to the previous one.
    Thanks
    Attached Images Attached Images

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,229
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Problem with libusb in macOS high Sierra

    Are your libraries being linked into your executable in the correct order? Unlike Microsoft C++, linux linkers usually require libraries to be linked in order of dependence. That is, if library A requires symbols that are defined in library B, then library A must be listed first, followed by library B. If you have them listed in reverse order, then the symbols needed by library A will not be loaded from library B and you will get an undefined symbol error.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Problem with libusb in macOS high Sierra

    Quote Originally Posted by Eduardo Huerta View Post
    Compile the libusb source code with my program and show an error similar to the previous one.
    Still looks like you have a library built for something other than 64-bit x86. Is the old one still present on your machine?

    Seems odd...I am no Mac person, but I did not think that there was such a beast as a 32-bit OS X... and therefore little call for non-64-bit libraries.

Similar Threads

  1. Replies: 0
    Last Post: 15th November 2016, 06:25
  2. Replies: 4
    Last Post: 6th March 2014, 06:57
  3. Replies: 6
    Last Post: 7th November 2012, 06:13
  4. Phonon - audio-output-problem and high latency
    By nearlyNERD in forum Qt Programming
    Replies: 3
    Last Post: 27th June 2012, 22:17
  5. MacOs deployment problem (QT 4.6.2)
    By Annihilator in forum Installation and Deployment
    Replies: 1
    Last Post: 3rd April 2010, 16:28

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.