Error on OpenGl_GlFunctions.hxx with glext.h

Hello,

With the current use of glext.h, we are getting a build error in our project. When we manually change the name of glext.h to OpenGl_glext.h and then include the use on line 96 of OpenGl_GlFunctions.hxx with this new name and compile the source code from the beginning, we do not encounter any build errors in the project. Unfortunately, this method is not suitable for continuous use. While the glext.h file is located in the Linux operating system, Qt and OCCT, it causes conflicts. The first thing I would like to ask you is: Do you plan to change the name of glext.h directly to prevent us this conflict in the next OCCT releases? Or do you have a suggestion so that we can overcome the build errors in the project? Thank you very much in advance.

We've built source code with version 7.6, 7.7 from https://github.com/Open-Cascade-SAS/OCCT/tags

Build Errors:

/usr/include/opencascade/OpenGl_GlFunctions.hxx:877: error: ‘PFNGLCLIENTACTIVETEXTUREPROC’ does not name a type; did you mean ‘PFNGLCLIENTACTIVETEXTUREARBPROC’? PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture; ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ PFNGLCLIENTACTIVETEXTUREARBPROC

/usr/include/opencascade/OpenGl_GlFunctions.hxx:878: error: ‘PFNGLMULTITEXCOORD1DPROC’ does not name a type; did you mean ‘PFNGLMULTITEXCOORD1HNVPROC’? PFNGLMULTITEXCOORD1DPROC glMultiTexCoord1d; ^~~~~~~~~~~~~~~~~~~~~~~~ PFNGLMULTITEXCOORD1HNVPROC

/usr/include/opencascade/OpenGl_GlFunctions.hxx:879: error: ‘PFNGLMULTITEXCOORD1DVPROC’ does not name a type; did you mean ‘PFNGLMULTITEXCOORD1HNVPROC’? PFNGLMULTITEXCOORD1DVPROC glMultiTexCoord1dv; ^~~~~~~~~~~~~~~~~~~~~~~~~ PFNGLMULTITEXCOORD1HNVPROC

/usr/include/opencascade/OpenGl_GlFunctions.hxx:880: error: ‘PFNGLMULTITEXCOORD1FPROC’ does not name a type; did you mean ‘PFNGLMULTITEXCOORD1HNVPROC’? PFNGLMULTITEXCOORD1FPROC glMultiTexCoord1f; ^~~~~~~~~~~~~~~~~~~~~~~~ PFNGLMULTITEXCOORD1HNVPROC

/usr/include/opencascade/OpenGl_GlFunctions.hxx:881: error: ‘PFNGLMULTITEXCOORD1FVPROC’ does not name a type; did you mean ‘PFNGLMULTITEXCOORD1HNVPROC’? PFNGLMULTITEXCOORD1FVPROC glMultiTexCoord1fv; ^~~~~~~~~~~~~~~~~~~~~~~~~ PFNGLMULTITEXCOORD1HNVPROC

and more similar errors ...

Kirill Gavrilov's picture

Do you plan to change the name of glext.h

This idea appeared some time ago, but I guess this wasn't done yet just because nobody created an issue on Bugtracker. Though I don't think that renaming the file would solve all problems.

do you have a suggestion so that we can overcome the build errors in the project?

In general, due to the nature how OpenGL headers currently shipped with various systems and frameworks (Qt, OCCT), it is impossible to completely avoid collisions while including headers within the same .cpp file. So that the most straight-forward solution to the problem that wouldn't require changing Qt, OCCT or some other OpenGL-based library is to not include OpenGL-wrapping headers within the same header/source file at application level. If you have to mix calls within the same C++ class - create two .cpp files (like MyClass_qt.cpp and MyClass_occt.cpp) implementing different methods of the same C++ class, so that one file would include OpenGL headers from Qt, and another - OpenGL headers from OCCT.

Nezihe Sözen's picture

Many thanks for supporting with your comments and for changing the header name (as far as I see on Bug Tracker, you've already reviewed this issue : https://tracker.dev.opencascade.org/view.php?id=32720 ). Actually, this solution is enough for conflicts on our project. I hope it doesn't cause any other bugs and you will include it in your releases.