Results 1 to 2 of 2

Thread: qmake is not finding some existing libraries

  1. #1
    Join Date
    Jun 2011
    Location
    Porto Alegre, Brazil
    Posts
    482
    Thanks
    165
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default qmake is not finding some existing libraries

    I'm having a problem when including two libraries (not made by me) into my (pure C) project in Qt Creator (using qmake + GCC on Linux Ubuntu).

    I know that, to include a lib, one uses the LIBS directive as explained in this SO answer; and I have successfully inserted libraries both in Linux as well as in Windows this way. Even more, in this same problematic project I have two successfully inserted libraries.

    But now I'm having a problem including this two other libs in this same project. One of this libraries is C6RUN, required for conversation between two processors, and inside the library's folder there is a /bin and a /lib folder; the first has some files with no extension (they are not a .a or .lib) while the second have, inside two child folders, a set of .a . The other library is inside a folder with a /lib subfolder with a .lib inside. Both of them are working 100% in a project in Eclipse (so no qmake/Qt Creator involved). I mentioned the /bin folder of the first library because in a Makefile related to the Eclipse-based project two of its files are referenced despite not being formally library files.

    When trying to link both libraries in the .pro, I do EXACTLY the same thing as always: add the path with -L plus the name of the lib with -l. When I try to do that with those two libs, errors occur. What follows is the list with actions + results (actually I tried even some other options, but none of the results were different from the two shown below):

    First lib 1

    .pro

    LIBS += -L$${COMMON_PATH}/linux-devkit/c6run/lib/c6run_dsp -llibc6run

    result

    error: connot find -llibc6run
    First lib 2

    .pro

    LIBS += -L$${COMMON_PATH}/linux-devkit/c6run/lib/c6run_dsp -lc6run

    result

    compiles fine.

    when calling a respective method inside main.cpp / int main():

    error: undefined reference of <method name>
    First lib 3

    .pro

    LIBS += -L$${COMMON_PATH}/linux-devkit/c6run/bin -lc6runlib-ar

    result

    error: connot find -lc6runlib-ar
    Second lib 1

    .pro

    LIBS += -L$${RE8K_REPO}/main_projects/lib_calc_dsp/lib -lcalculos

    result

    error: connot find -lcalculos
    Second lib 2

    .pro

    LIBS += -L$${RE8K_REPO}/main_projects/lib_calc_dsp/lib/calculos.lib

    result

    compiles fine.

    when calling a respective method inside main.cpp / int main():

    error: undefined reference of <method name>
    So, what could I be missing?
    May the Lord be with you. Always.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,360
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: qmake is not finding some existing libraries

    .lib files are likely for Windows. .a files are static archives and not dynamically loaded objects. Try referring to them directly without the -l prefix and provide full name including the extension. Be careful, if the libraries depend on each other then the order of passing them to the compiler matters!
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. qmake not existing
    By Yes in forum Newbie
    Replies: 7
    Last Post: 6th December 2019, 18:40
  2. Error compiling Qtdeclarative for arm / cannot find existing libraries
    By Plox in forum Installation and Deployment
    Replies: 1
    Last Post: 13th November 2013, 20:40
  3. Program not finding an existing double in a QList<double>
    By aarelovich in forum Qt Programming
    Replies: 2
    Last Post: 9th May 2011, 21:59
  4. how to exclude few libraries from existing QT source code?
    By nivditha in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 13th October 2010, 08:06
  5. qmake and libraries question
    By bnilsson in forum Qt Programming
    Replies: 4
    Last Post: 28th June 2008, 19:30

Tags for this Thread

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.