Compilation error with a library file
-
wrote on 22 Sept 2014, 19:31 last edited by
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 statusI 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.htmlMoreover, 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.pdfThank you for your help.
-
wrote on 22 Sept 2014, 20:31 last edited by
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.
-
wrote on 22 Sept 2014, 20:33 last edited by
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/linuxunix:!macx: PRE_TARGETDEPS += $$PWD/../HIDAPI/linux/libHIDAPI.a@
1/3