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 1I 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 -lpthreadIf 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 -lpthreadso 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.
-
Hi,
Might be a silly question but did you install the Qt dev packages from your distribution ?
-
-
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.
-
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.
-
@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
-
The "Topic Tools" button.