Cannot run make



  • Hello,

    I have been using Qtcreator for a while without problem. However I haven't create new project since a while. Today I wanted to create a c++ library. So I created the project and tried to compile it (just like it's created without wriote anything yet), I got the error:
    /usr/bin/ld: cannot find -lQt5Sql
    /usr/bin/ld: cannot find -lQt5Core
    collect2: error: ld returned 1 exit status
    I went to the directory where the make file is created and ran make. Same error.
    make
    rm -f libproperties.so.1.0.0 libproperties.so libproperties.so.1 libproperties.so.1.0
    g++ -m32 -shared -Wl,-soname,libproperties.so.1 -o libproperties.so.1.0.0 properties.o -lQt5Sql -lQt5Core -lpthread
    /usr/bin/ld: cannot find -lQt5Sql
    /usr/bin/ld: cannot find -lQt5Core
    collect2: error: ld returned 1 exit status
    Makefile:142: recipe for target 'libproperties.so.1.0.0' failed
    make: *** [libproperties.so.1.0.0] Error 1

    I went to the building dir of a previous project and ran make there to see if there is any differences and noticed the call to Qt libraries is different:
    g++ -m32 -o get_properties main.o set_properties.o -isystem /usr/include/x86_64-linux-gnu/qt5/Qt5Sql -isystem /usr/include/x86_64-linux-gnu/qt5/Qt5Core -lpthread

    If instead of run make I ran directly the h++ line with the "previous" path it works.
    g++ -m32 -shared -Wl,-soname,libproperties.so.1 -o libproperties.so.1.0.0 properties.o -isystem /usr/include/x86_64-linux-gnu/qt5/Qt5Sql -isystem /usr/include/x86_64-linux-gnu/qt5/Qt5Core -lpthread

    so I understand something is wrong in the "new" makefile. But I don't now how qtcreator manage it.

    Any help?

    Thanks



  • Hi @laetis,

    I guess you use QMake to build your projects? So qmake creates the Makefile and then make builds your program.

    You have already investigated a lot, and from your information I'd say the Kit (combination of Compiler, Qt version and Debugger) you use to build your library is corrupted.

    When you first create a project, a projects settings screen should appear. You can get it later by clicking the Projects icon at the left bar or pressing Ctrl+5.

    Maybe you can post a picture what you see there? This should give a hint what's going on.


  • Lifetime Qt Champion

    Hi,

    Might be a silly question but did you install the Qt dev packages from your distribution ?



  • @aha_1980
    Hi,
    I looked in projects part and indeed the qmake path is different:
    qmake: qmake test.pro -r -spec linux-g++-32 CONFIG+=debug for the not working
    qmake: qmake ChemAliveMolOpt2_0.pro -r -spec linux-g++-64 CONFIG+=debug for the working.
    How can I change that?



  • Hi @laetis,

    Repeating myself:

    When you first create a project, a projects settings screen should appear. You can get it later by clicking the Projects icon at the left bar or pressing Ctrl+5.

    Maybe you can post a picture what you see there? This should give a hint what's going on.


  • Lifetime Qt Champion

    Do you have a 32bit version of Qt installed ?

    From the looks of it, you are trying to build a 32bit application on a 64bit Linux installation.



  • @SGaist
    Indeed I have a 64bit installation not a 32. What I don't know is how to tell Qtcreator to not try do a 32bit app...


  • Moderators

    @laetis said in Cannot run make:

    What I don't know is how to tell Qtcreator to not try do a 32bit app

    Select your 64bit Kit



  • @jsulm Found it. thanks! Works fine now.



  • @laetis Ok, then please mark this thread as solved.

    Thanks.



  • @aha_1980 how?


  • Lifetime Qt Champion

    The "Topic Tools" button.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.