Build: error: 'GL_PRIMITIVE_RESTART' was not declared in this scope

Build: error: 'GL_PRIMITIVE_RESTART' was not declared in this scope

Discuss everything related to compiling and running Spring on Mac OS X.

Moderator: Moderators

Post Reply
User avatar
MasterBel2
Posts: 347
Joined: 11 Apr 2016, 12:03

Build: error: 'GL_PRIMITIVE_RESTART' was not declared in this scope

Post by MasterBel2 » 11 Sep 2017, 13:27

Build is succeeding up to this point. Spring engine version: 103.0.1-1384-ga0f4d3f84 develop. Any ideas?

Code: Select all

[ 80%] Building CXX object rts/builds/legacy/CMakeFiles/engine-legacy.dir/__/__/Map/SMF/Legacy/LegacyMeshDrawer.cpp.o
/Users/MasterBel2/Spring/Sources/spring/rts/Map/SMF/Basic/BasicMeshDrawer.cpp: In member function 'virtual void CBasicMeshDrawer::DrawMesh(const DrawPass::e&)':
/Users/MasterBel2/Spring/Sources/spring/rts/Map/SMF/Basic/BasicMeshDrawer.cpp:614:11: error: 'GL_PRIMITIVE_RESTART' was not declared in this scope
  glEnable(GL_PRIMITIVE_RESTART);
           ^
/Users/MasterBel2/Spring/Sources/spring/rts/Map/SMF/Basic/BasicMeshDrawer.cpp: In member function 'virtual void CBasicMeshDrawer::DrawBorderMesh(const DrawPass::e&)':
/Users/MasterBel2/Spring/Sources/spring/rts/Map/SMF/Basic/BasicMeshDrawer.cpp:679:11: error: 'GL_PRIMITIVE_RESTART' was not declared in this scope
  glEnable(GL_PRIMITIVE_RESTART);
           ^
make[3]: *** [rts/builds/legacy/CMakeFiles/engine-legacy.dir/__/__/Map/SMF/Basic/BasicMeshDrawer.cpp.o] Error 1
0 x


MasterBel
Posts: 158
Joined: 18 Mar 2018, 07:48

Re: Build: error: 'GL_PRIMITIVE_RESTART' was not declared in this scope

Post by MasterBel » 04 May 2018, 04:58

Now that cmake . command is working again, it seems that there is a different error:

Code: Select all

In file included from /Users/masterbel2/Spring/Sources/spring/tools/unitsync/../../rts/Sim/Objects/SolidObject.h:8:0,
                 from /Users/masterbel2/Spring/Sources/spring/tools/unitsync/../../rts/Sim/Features/Feature.h:11,
                 from /Users/masterbel2/Spring/Sources/spring/rts/Lua/LuaUtils.h:17,
                 from /Users/masterbel2/Spring/Sources/spring/rts/Lua/LuaConstEngine.cpp:5:
/Users/masterbel2/Spring/Sources/spring/tools/unitsync/../../rts/Rendering/Models/3DModel.h: In member function 'void S3DModel::BindVertexArray() const':
/Users/masterbel2
/Spring/Sources/spring/tools/unitsync/../../rts/Rendering/Models/3DModel.h:262:33: error: 'glBindVertexArray' was not declared in this scope
  void BindVertexArray() const { glBindVertexArray(vertexArray); }
                                 ^~~~~~~~~~~~~~~~~
/Users/masterbel2/Spring/Sources/spring/tools/unitsync/../../rts/Rendering/Models/3DModel.h:262:33: note: suggested alternative: 'BindVertexArray'
  void BindVertexArray() const { glBindVertexArray(vertexArray); }
                                 ^~~~~~~~~~~~~~~~~
                                 BindVertexArray
/Users/masterbel2/Spring/Sources/spring/tools/unitsync/../../rts/Rendering/Models/3DModel.h: In member function 'void S3DModel::UnbindVertexArray() const':
/Users/masterbel2/Spring/Sources/spring/tools/unitsync/../../rts/Rendering/Models/3DModel.h:265:35: error: 'glBindVertexArray' was not declared in this scope
  void UnbindVertexArray() const { glBindVertexArray(0); }
                                   ^~~~~~~~~~~~~~~~~
/Users/masterbel2/Spring/Sources/spring/tools/unitsync/../../rts/Rendering/Models/3DModel.h:265:35: note: suggested alternative: 'BindVertexArray'
  void UnbindVertexArray() const { glBindVertexArray(0); }
                                   ^~~~~~~~~~~~~~~~~
                                   BindVertexArray
Now glBindVertexArray is declared in the glew.h included in Spring, so I don't know what's going on there. Apparently all other GL functions in that file are working? I don't know. No one else seems to ever have a problem with it. Turboss's buildslave comes up with the same issue.

If I were to include the said file (because based on my research there's a slight chance it's to blame) I don't know where I'd include it? Simply in 3DModel.h? And would include glew.h or OpenGL/gl3.h?
0 x

MasterBel
Posts: 158
Joined: 18 Mar 2018, 07:48

Re: Build: error: 'GL_PRIMITIVE_RESTART' was not declared in this scope

Post by MasterBel » 04 May 2018, 06:46

Also, apparently glew.h has this line:

#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray)

So it should be in the scope?

Anyway I experimented with changing references to gl.h to gl3.h. No success. I only got more errors, if any result.
0 x

Post Reply

Return to “Mac OS X”