Fatal error C1083: Cannot open include file: 'GLES2/gl2.h': No such file or directory

  • I am trying to get a basic VS2012 GUI app to compile and I am getting the error:

    @1>g:\qt\5.1.1\qtbase\include\qtgui../../src/gui/opengl/qopengl.h(82): fatal error C1083: Cannot open include file: 'GLES2/gl2.h': No such file or directory@

    I did see that I need to have the DirectX SDK installed, which I installed the latest one, then did a clean build of 5.1.1, but I am still getting this error. Here is how I am configuring Qt:

    @configure -prefix g:\qt\5.1.1\qtbase -debug-and-release -opensource -nomake tests -platform win32-msvc2012 @

  • Moderators

    this include file should be in <QTDIR>\qtbase\include
    If it's there your project doesn't have this folder set as include directory.

  • I am finding gl2.h in <QTDIR>\qtbase\include\QtANGLE\GLES2. I added $(QTDIR)\include\QtANGLE to the VS2012 path and it compiles just fine.

    In time I am going to be creating a .pro file to generate the both .vcxproj files for Visual Studio and makefiles for other OS's. Is there something special I need to do to the .pro file to make sure that $(QTDIR)\include\QtANGLE is in the include path?

  • Moderators

    you can try setting the "INCLUDEPATH variable":http://qt-project.org/doc/qt-4.8/qmake-variable-reference.html#includepath in your pro file.

  • I had this issue whilst creating a QT Application project in VS2015 (QT 5.5), using the QT5Package extension (qt open source & VS2015 community edition).

    As with scarleton, adding "<QTDIR>\qtbase\include\QtANGLE\GLES2" to the project include path resolved the issue.

Log in to reply