Configure QtCreator in RPi3
-
wrote on 5 May 2019, 20:57 last edited by
Hello,
I'm not sure that QtCreator is properly configured on my RPi3.
Thus, when I launch the simplest application, the following compilation error appears:cannot find -lGLESv2 collect2: error: ld returned 1 exit status.
-
Hi,
This has nothing to do with Qt Creator. See this post on the RaspberryPi stack exchange site.
-
wrote on 5 May 2019, 21:28 last edited by
If I properly understood the solution from your link, -lGLESv2 option should be changed for -lbrcmGLESv2 in the Makefile. I did it in QtCreator project Makefile.
The problem persists. -
I'd check the RPi3 mkspec and change it there.
-
wrote on 5 May 2019, 21:49 last edited by
What do you mean saying "change it there". After all, when I launch project compiling, it is local Makefile (i.e. in the QtCreator project directory) that is used for compilation.
-
Qt's various platforms configuration are stored in what is call a mkspec. These files contains the set of compiler and linker options to use. Hence go to that folder, more specifically the one called devices in which you will find the RPi3 specific mkspec.
-
wrote on 5 May 2019, 22:15 last edited by
Have you any idea where can I find this mkspec.
-
Under the mkspecs folder in your Qt installation.
-
wrote on 6 May 2019, 23:38 last edited by
@SGaist
I installed Qt quite a while ago and don't remember how I proceeded at that time. I can identify QtCreator location using which qtcreator, but for framework it doesn't work. Do you have any idea how to find it ?
Thanks. -
Go to the preferences -> build and run -> Qt Versions.
-
wrote on 8 May 2019, 11:32 last edited by
There is no build and run in preferences.
-
It's
Build & Run
, but some stuff has changed, so depending on your Qt Creator version, it's underKits
. -
wrote on 8 May 2019, 17:26 last edited by
Well, I'm not sure I understood you correctly.
I've found QtCreator in Programming section of Application menu.
But neither section in Application menu mentions Qt framework itself.
The location of QtCreator executive I can check with
"which qtcreator" command.
It's located in /usr/bin. But there is no any folder named mkspec. -
Well, I'm not sure I understood you correctly.
I've found QtCreator in Programming section of Application menu.
But neither section in Application menu mentions Qt framework itself.
The location of QtCreator executive I can check with
"which qtcreator" command.
It's located in /usr/bin. But there is no any folder named mkspec.Please start Qt Creator, go to menu Tools > Options > Kits (or Build & Run if you have an older Qt Creator version) > Qt Versions:
There you have all your Qt versions listed and the path to
qmake
Regards
-
wrote on 8 May 2019, 17:45 last edited by
Yes, I've located it. Thanks.
What about -lGLESv2 option ? I didn't find any makefile in mkspecs directory.
Only qconfig.pri, qfeatures.pri, qmodule.pri. Should I check any of them for -lGLESv2 option ? -
No, it's in the devices subfolder. The one dedicated to RPi3.
-
wrote on 9 May 2019, 18:01 last edited by
There are 4 subfolders in devices subfolder that are in relation with RPi:
- linux-rasp-pi2-g++
- linux-rasp-pi-g++
- linux-rpi3-g++
- linux-rasp-vc-g++
Inside of all these subfolder there are filses qmake.conf
In every there are settings:
QMAKE_LIBS_EGL = -lEGL -lGLESv2 QMAKE_LIBS_OPENVG = -lEGL -lOpenVG -lGLESv2
I replaced GLESv2 with brcmGLESv2 in all qmake.conf files (i.e. in 4 folders).
Didn't help: when compiling project in QtCreator, I still see the same error message:
cannot find -lGLESv2 -
Might be a silly question but are you sure you are modifying the one from your self-built Qt ?
-
wrote on 9 May 2019, 22:47 last edited by
I modify those, found in the location, specified in QtCreator: Tools->Options->Kits->Qt Versions
-
Did you check what your Kits are using as mkspecs ?
1/20