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
  • 6,158
  • 8
  • 38
  • 63

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
  • 339
  • 2
  • 5
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.