3

I've compiled my project many times over, both in release and debug configuration. Suddenly, an error appears:

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

This is a Qt project in Visual Studio 2017 Community with the Qt add-in, using Qt 5.6.1-64.

I tried to search on google but there seems to be no advice that applies to this issue.

Farhad
  • 4,119
  • 8
  • 43
  • 66
Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778
  • Your project worked before with that configuration(VS 2017, add-in, Qt 5.6.1-64.) suddenly not working? – Farhad Aug 24 '17 at 16:14
  • Did you change the Qt version from one using ANGLE to one using desktop OpenGL? – PeterT Aug 24 '17 at 16:14
  • Yeah, I compiled on the same computer with the same settings in the same IDE three days ago and no problems occured. I am totally lost. I tried to rebuild but the issue persists. – Tomáš Zato Aug 24 '17 at 16:15
  • It's a long shot but... try remove all debug/release folder and build again. – Farhad Aug 24 '17 at 16:17
  • 1
    I found out that it's related to QTXlsx library. I'll document my steps, maybe it will help someone else. – Tomáš Zato Aug 24 '17 at 16:27

2 Answers2

3

I suffering the same problem. solved by adding this Include :

$(QTDIR)\include\QtANGLE

I found this solution by notice that project created by Qt Creator can be build without error. And find this include in qmake generated Makefile.

欢乐的Xiaox
  • 479
  • 4
  • 6
0

I will document my steps for fixing this, it may help even if you have a different issue.

  1. I watched which cpp file triggers the error
  2. I commented it out completely, then re-added lines until error appeared
  3. It was triggered by an #include statement
  4. I enabled the Include tree output from the compiler
  5. I found that the include comes from QtXlsx library which includes <QtGui/QtGui> through C:\Qt\5.6.1-64\include\QtXlsx\QtXlsxDepends. Note that we use GUI in this project, so there must be additional issue that causes this.

I commented out #include <QtGui/QtGui> from the QtXlsxDepends file. I noted this to myself to find the real cause of the error.

However everything compiles and works after this change. I will improve this answer after further investigation.

Tomáš Zato
  • 50,171
  • 52
  • 268
  • 778