Unable to build on windows 11 & Qt 5.12 because of linker error
-
Hello,
I am trying to build https://github.com/QUItCoding/qnanopainter which seems to use the following in the pri file
win32 { equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 14) { CONFIG += windows_with_gles QT_CONFIG += opengles2 angle CONFIG( debug, debug|release ) { debug LIBS+= -llibGLESv2d } else { release LIBS+= -llibGLESV2 } } }
When I try to build it, it is giving me an error
:-1: error: LNK1104: cannot open file 'libGLESv2d.lib'
I see that this lib is present in the Qt folder itself, however trying to include in lib path or system path seems to have no effect.
Environment :
Qt 5.12.12 MSVC2017 64bit
Windows 11Any hints or suggestions would be greatly appreciated.
Thanks.
-
I doubt there is a libGLESv2d.lib in the qt's lib or bin folder and I don't know why you should link against it. Remove it from the pro file.
-
@Christian-Ehrlicher This is the file referred to by the OP. The PRI file is used when building the examples only; the main library uses CMake.
The comment that the OP omitted reads:
# Note: Due to Angle, windows might use either OpenGL (desktop) or # OpenGL ES (angle) backend. Newer Qt versions don't automatically # link with OpenGL ES libraries. win32 { equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 14) { ...
This might provide a reason for explicitly linking the library. Like you I imagine this needs to be provided separately. It also strikes me that the comment and the PRO file logic are opposite in regard to the Qt versions i.e., it explicitly links for older version not newer versions.