Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Configure QtCreator in RPi3
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.
This has nothing to do with Qt Creator. See this post on the RaspberryPi stack exchange site.
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.
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.
Have you any idea where can I find this mkspec.
Under the mkspecs folder in your Qt installation.
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 ?
Go to the preferences -> build and run -> Qt Versions.
There is no build and run in preferences.
Build & Run, but some stuff has changed, so depending on your Qt Creator version, it's under
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
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.
There are 4 subfolders in devices subfolder that are in relation with RPi:
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 ?
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 ?