Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Compilation error with a library file

Compilation error with a library file

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 929 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.
  • J Offline
    J Offline
    jim53
    wrote on last edited by
    #1

    Hello everyone,

    I am working on a project to communicate via USB with a Microchip microcontroller.
    I use Qt 5.2.1 (GCC 4.8.2, 32 bits) under ubuntu 14.04.
    I have download the sample source code from Microchip web site but when I want to compile it, I have two errors.

    bq. Connot find lHIDAPI
    collect2: error: ld returned 1 exit status

    I think I have a problem with a library file but I know how solve it. I am not an expert using the library file.

    If someone can help me the source code can be download here :
    "Microchip Library Application (MLA Linux version)":http://www.microchip.com/pagehandler/en-us/devtools/mla/home.html

    Moreover, there is a link to a guide :
    "Cros Platform custom HID demo...":http://ewh-bp-project.googlecode.com/hg-history/c35f016e9db74dbaf85acad23da43309738aaad9/trunk/PIC_code/BP USB code/PnP Demo - Cross Platform Software/Getting Started - Cross Platform Custom HID Demo.pdf

    Thank you for your help.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on last edited by
      #2

      Assuming that you are trying to compile a native Linux Qt based program to talk via USB then you need to get your LIBS variable correct in your PRO file. It looks like you are missing a hyphen (-) before the "lHIDAPI" in LIBS. It is possible you are missing a -L option also. This is only a guess though.

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jim53
        wrote on last edited by
        #3

        I have found the solution, I have replace :
        @unix: !macx: LIBS += -L../HIDAPI/linux -lHIDAPI @

        by

        @unix:!macx: LIBS += -L$$PWD/../HIDAPI/linux/ -lHIDAPI

        INCLUDEPATH += $$PWD/../HIDAPI/linux
        DEPENDPATH += $$PWD/../HIDAPI/linux

        unix:!macx: PRE_TARGETDEPS += $$PWD/../HIDAPI/linux/libHIDAPI.a@

        1 Reply Last reply
        0

        • Login

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