Garux / netradiant-custom

The open-source, cross-platform level editor for id Tech based games.
https://garux.github.io/NRC/
Other
301 stars 52 forks source link

GL Compile errors on linux #122

Closed ghost closed 1 year ago

ghost commented 1 year ago

This could possibly be a gl or qt issue, i think its gl, I installed all of the dependencies and followed the instructions on the compiling document, this was the result:

All required libraries have been found!

g++ plugins/entity/doom3group.cpp   -MMD -W -Wall -Wcast-align -Wcast-qual -Wno-unused-parameter -fno-strict-aliasing -O3 -fPIC -std=c++17 -Wreorder -fno-exceptions -fno-rtti -Ilibs -Iinclude -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/x86_64-linux-gnu/qt5 -DNDEBUG -DPOSIX -DXWINDOWS -DRADIANT_VERSION="\"1.6.0n-git-e38ed26d\"" -DRADIANT_MAJOR_VERSION="\"6\"" -DRADIANT_MINOR_VERSION="\"0\"" -DRADIANT_ABOUTMSG="\"Custom build\"" -DQ3MAP_VERSION="\"2.5.17n-git-e38ed26d\"" -DRADIANT_EXECUTABLE="\"x86_64\""  -c -o plugins/entity/doom3group.o
In file included from include/modulesystem.h:25,
                 from include/iscenegraph.h:190,
                 from libs/scenelib.h:24,
                 from include/editable.h:26,
                 from plugins/entity/doom3group.cpp:34:
libs/traverselib.h: In member function ‘virtual void TraversableNodeSet::insert(scene::Node&)’:
libs/traverselib.h:180:33: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
  180 |                 ASSERT_MESSAGE( (volatile intptr_t)&node != 0, "TraversableNodeSet::insert: sanity check failed" );
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~
libs/debugging/debugging.h:106:25: note: in definition of macro ‘ASSERT_MESSAGE’
  106 |                 if ( !( condition ) ) \
      |                         ^~~~~~~~~
libs/traverselib.h: In member function ‘virtual void TraversableNodeSet::erase(scene::Node&)’:
libs/traverselib.h:193:33: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
  193 |                 ASSERT_MESSAGE( (volatile intptr_t)&node != 0, "TraversableNodeSet::erase: sanity check failed" );
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~
libs/debugging/debugging.h:106:25: note: in definition of macro ‘ASSERT_MESSAGE’
  106 |                 if ( !( condition ) ) \
      |                         ^~~~~~~~~
In file included from libs/entitylib.h:29,
                 from plugins/entity/doom3group.cpp:41:
include/igl.h: At global scope:
include/igl.h:44:9: error: ‘QOpenGLFunctions_2_0’ does not name a type
   44 |         QOpenGLFunctions_2_0 *funcs;
      |         ^~~~~~~~~~~~~~~~~~~~
include/igl.h: In constructor ‘OpenGLBinding::OpenGLBinding()’:
include/igl.h:46:50: error: class ‘OpenGLBinding’ does not have any field named ‘funcs’
   46 |         OpenGLBinding() : contextValid( false ), funcs( nullptr ){
      |                                                  ^~~~~
include/igl.h: At global scope:
include/igl.h:94:8: error: ‘QOpenGLFunctions_2_0’ does not name a type
   94 | inline QOpenGLFunctions_2_0& gl(){
      |        ^~~~~~~~~~~~~~~~~~~~
In file included from plugins/entity/doom3group.cpp:41:
libs/entitylib.h: In function ‘void arrow_draw(const Vector3&, const Vector3&, const Vector3&, const Vector3&)’:
libs/entitylib.h:53:9: error: ‘gl’ was not declared in this scope
   53 |         gl().glBegin( GL_LINES );
      |         ^~
libs/entitylib.h:53:23: error: ‘GL_LINES’ was not declared in this scope
   53 |         gl().glBegin( GL_LINES );
      |                       ^~~~~~~~
libs/entitylib.h: In function ‘void aabb_draw_wire(const Vector3*)’:
libs/entitylib.h:128:9: error: ‘gl’ was not declared in this scope
  128 |         gl().glVertexPointer( 3, GL_FLOAT, 0, points );
      |         ^~
libs/entitylib.h:128:34: error: ‘GL_FLOAT’ was not declared in this scope
  128 |         gl().glVertexPointer( 3, GL_FLOAT, 0, points );
      |                                  ^~~~~~~~
libs/entitylib.h:129:30: error: ‘GL_LINES’ was not declared in this scope
  129 |         gl().glDrawElements( GL_LINES, sizeof( indices ) / sizeof( indices[0] ), GL_UNSIGNED_INT, indices );
      |                              ^~~~~~~~
libs/entitylib.h:129:82: error: ‘GL_UNSIGNED_INT’ was not declared in this scope
  129 |         gl().glDrawElements( GL_LINES, sizeof( indices ) / sizeof( indices[0] ), GL_UNSIGNED_INT, indices );
      |                                                                                  ^~~~~~~~~~~~~~~
libs/entitylib.h: In function ‘void aabb_draw_flatshade(const Vector3*)’:
libs/entitylib.h:141:9: error: ‘gl’ was not declared in this scope
  141 |         gl().glBegin( GL_QUADS );
      |         ^~
libs/entitylib.h:141:23: error: ‘GL_QUADS’ was not declared in this scope
  141 |         gl().glBegin( GL_QUADS );
      |                       ^~~~~~~~
libs/entitylib.h: In function ‘void aabb_draw_textured(const AABB&)’:
libs/entitylib.h:198:9: error: ‘gl’ was not declared in this scope
  198 |         gl().glBegin( GL_QUADS );
      |         ^~
libs/entitylib.h:198:23: error: ‘GL_QUADS’ was not declared in this scope
  198 |         gl().glBegin( GL_QUADS );
      |                       ^~~~~~~~
In file included from plugins/entity/doom3group.cpp:42:
libs/render.h: At global scope:
libs/render.h:37:7: error: ‘GLenum’ does not name a type; did you mean ‘enum’?
   37 | const GLenum RenderIndexTypeID = GL_UNSIGNED_INT;
      |       ^~~~~~
      |       enum
In file included from plugins/entity/doom3group.cpp:42:
libs/render.h: In destructor ‘DepthTestedPointVertex::~DepthTestedPointVertex()’:
libs/render.h:781:25: error: ‘gl’ was not declared in this scope
  781 |                         gl().glDeleteQueries( 1, &query );
      |                         ^~
libs/render.h: In function ‘void pointvertex_gl_array(const PointVertex_t*)’:
libs/render.h:846:9: error: there are no arguments to ‘gl’ that depend on a template parameter, so a declaration of ‘gl’ must be available [-fpermissive]
  846 |         gl().glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( PointVertex_t ), &array->colour );
      |         ^~
libs/render.h:846:9: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
libs/render.h:846:33: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope
  846 |         gl().glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( PointVertex_t ), &array->colour );
      |                                 ^~~~~~~~~~~~~~~~
libs/render.h:847:9: error: there are no arguments to ‘gl’ that depend on a template parameter, so a declaration of ‘gl’ must be available [-fpermissive]
  847 |         gl().glVertexPointer( 3, GL_FLOAT, sizeof( PointVertex_t ), &array->vertex );
      |         ^~
libs/render.h:847:34: error: ‘GL_FLOAT’ was not declared in this scope
  847 |         gl().glVertexPointer( 3, GL_FLOAT, sizeof( PointVertex_t ), &array->vertex );
      |                                  ^~~~~~~~
libs/render.h: At global scope:
libs/render.h:854:15: error: ‘GLenum’ does not name a type; did you mean ‘enum’?
  854 |         const GLenum m_mode;
      |               ^~~~~~
      |               enum
libs/render.h:856:66: error: ‘GLenum’ has not been declared
  856 |         RenderablePointArray( const Array<PointVertex_t>& array, GLenum mode )
      |                                                                  ^~~~~~
libs/render.h: In constructor ‘RenderablePointArray<PointVertex_t>::RenderablePointArray(const Array<PointVertex_t>&, int)’:
libs/render.h:857:37: error: class ‘RenderablePointArray<PointVertex_t>’ does not have any field named ‘m_mode’
  857 |                 : m_array( array ), m_mode( mode ){
      |                                     ^~~~~~
libs/render.h: In member function ‘void RenderablePointArray<PointVertex_t>::render(RenderStateFlags) const’:
libs/render.h:867:17: error: there are no arguments to ‘gl’ that depend on a template parameter, so a declaration of ‘gl’ must be available [-fpermissive]
  867 |                 gl().glDrawArrays( m_mode, 0, GLsizei( m_array.size() ) );
      |                 ^~
libs/render.h:867:36: error: ‘m_mode’ was not declared in this scope
  867 |                 gl().glDrawArrays( m_mode, 0, GLsizei( m_array.size() ) );
      |                                    ^~~~~~
libs/render.h: At global scope:
libs/render.h:874:15: error: ‘GLenum’ does not name a type; did you mean ‘enum’?
  874 |         const GLenum m_mode;
      |               ^~~~~~
      |               enum
libs/render.h:876:38: error: expected ‘)’ before ‘mode’
  876 |         RenderablePointVector( GLenum mode )
      |                              ~       ^~~~~
      |                                      )
libs/render.h: In member function ‘virtual void RenderablePointVector::render(RenderStateFlags) const’:
libs/render.h:882:17: error: ‘gl’ was not declared in this scope
  882 |                 gl().glDrawArrays( m_mode, 0, GLsizei( m_vector.size() ) );
      |                 ^~
libs/render.h:882:36: error: ‘m_mode’ was not declared in this scope
  882 |                 gl().glDrawArrays( m_mode, 0, GLsizei( m_vector.size() ) );
      |                                    ^~~~~~
libs/render.h:882:47: error: ‘GLsizei’ was not declared in this scope; did you mean ‘size’?
  882 |                 gl().glDrawArrays( m_mode, 0, GLsizei( m_vector.size() ) );
      |                                               ^~~~~~~
      |                                               size
libs/render.h: At global scope:
libs/render.h:905:15: error: ‘GLenum’ does not name a type; did you mean ‘enum’?
  905 |         const GLenum m_mode;
      |               ^~~~~~
      |               enum
libs/render.h:908:39: error: expected ‘)’ before ‘mode’
  908 |         RenderableVertexBuffer( GLenum mode, const VertexBuffer<PointVertex>& vertices )
      |                               ~       ^~~~~
      |                                       )
libs/render.h:906:42: warning: non-static reference ‘const VertexBuffer<PointVertex>& RenderableVertexBuffer::m_vertices’ in class without a constructor [-Wuninitialized]
  906 |         const VertexBuffer<PointVertex>& m_vertices;
      |                                          ^~~~~~~~~~
libs/render.h: In member function ‘virtual void RenderableVertexBuffer::render(RenderStateFlags) const’:
libs/render.h:914:17: error: ‘gl’ was not declared in this scope
  914 |                 gl().glDrawArrays( m_mode, 0, m_vertices.size() );
      |                 ^~
libs/render.h:914:36: error: ‘m_mode’ was not declared in this scope
  914 |                 gl().glDrawArrays( m_mode, 0, m_vertices.size() );
      |                                    ^~~~~~
libs/render.h: At global scope:
libs/render.h:920:15: error: ‘GLenum’ does not name a type; did you mean ‘enum’?
  920 |         const GLenum m_mode;
      |               ^~~~~~
      |               enum
libs/render.h:924:38: error: expected ‘)’ before ‘mode’
  924 |         RenderableIndexBuffer( GLenum mode, const IndexBuffer& indices, const VertexBuffer<PointVertex>& vertices )
      |                              ~       ^~~~~
      |                                      )
libs/render.h:921:28: warning: non-static reference ‘const IndexBuffer& RenderableIndexBuffer::m_indices’ in class without a constructor [-Wuninitialized]
  921 |         const IndexBuffer& m_indices;
      |                            ^~~~~~~~~
libs/render.h:922:42: warning: non-static reference ‘const VertexBuffer<PointVertex>& RenderableIndexBuffer::m_vertices’ in class without a constructor [-Wuninitialized]
  922 |         const VertexBuffer<PointVertex>& m_vertices;
      |                                          ^~~~~~~~~~
libs/render.h: In member function ‘virtual void RenderableIndexBuffer::render(RenderStateFlags) const’:
libs/render.h:931:17: error: ‘gl’ was not declared in this scope
  931 |                 gl().glDrawElements( m_mode, GLsizei( m_indices.size() ), RenderIndexTypeID, m_indices.data() );
      |                 ^~
libs/render.h:931:38: error: ‘m_mode’ was not declared in this scope
  931 |                 gl().glDrawElements( m_mode, GLsizei( m_indices.size() ), RenderIndexTypeID, m_indices.data() );
      |                                      ^~~~~~
libs/render.h:931:46: error: ‘GLsizei’ was not declared in this scope
  931 |                 gl().glDrawElements( m_mode, GLsizei( m_indices.size() ), RenderIndexTypeID, m_indices.data() );
      |                                              ^~~~~~~
libs/render.h:931:75: error: ‘RenderIndexTypeID’ was not declared in this scope; did you mean ‘RenderIndex’?
  931 |                 gl().glDrawElements( m_mode, GLsizei( m_indices.size() ), RenderIndexTypeID, m_indices.data() );
      |                                                                           ^~~~~~~~~~~~~~~~~
      |                                                                           RenderIndex
libs/render.h: At global scope:
libs/render.h:956:15: error: ‘GLenum’ does not name a type; did you mean ‘enum’?
  956 |         const GLenum m_mode;
      |               ^~~~~~
      |               enum
libs/render.h:958:80: error: ‘GLenum’ has not been declared
  958 |         RenderableDepthTestedPointArray( Array<DepthTestedPointVertex>& array, GLenum mode )
      |                                                                                ^~~~~~
libs/render.h: In constructor ‘RenderableDepthTestedPointArray::RenderableDepthTestedPointArray(Array<DepthTestedPointVertex>&, int)’:
libs/render.h:959:37: error: class ‘RenderableDepthTestedPointArray’ does not have any field named ‘m_mode’
  959 |                 : m_array( array ), m_mode( mode ){
      |                                     ^~~~~~
libs/render.h: In member function ‘virtual void RenderableDepthTestedPointArray::render(RenderStateFlags) const’:
libs/render.h:965:33: error: ‘gl’ was not declared in this scope
  965 |                                 gl().glGetQueryObjectuiv( p.query, GL_QUERY_RESULT, &sampleCount );
      |                                 ^~
libs/render.h:965:68: error: ‘GL_QUERY_RESULT’ was not declared in this scope
  965 |                                 gl().glGetQueryObjectuiv( p.query, GL_QUERY_RESULT, &sampleCount );
      |                                                                    ^~~~~~~~~~~~~~~
libs/render.h:974:25: error: ‘gl’ was not declared in this scope
  974 |                         gl().glDrawArrays( m_mode, 0, GLsizei( m_array.size() ) );
      |                         ^~
libs/render.h:974:44: error: ‘m_mode’ was not declared in this scope
  974 |                         gl().glDrawArrays( m_mode, 0, GLsizei( m_array.size() ) );
      |                                            ^~~~~~
libs/render.h:974:55: error: ‘GLsizei’ was not declared in this scope
  974 |                         gl().glDrawArrays( m_mode, 0, GLsizei( m_array.size() ) );
      |                                                       ^~~~~~~
libs/render.h:979:41: error: ‘gl’ was not declared in this scope
  979 |                                         gl().glGenQueries( 1, &p.query );
      |                                         ^~
libs/render.h:980:33: error: ‘gl’ was not declared in this scope
  980 |                                 gl().glBeginQuery( GL_SAMPLES_PASSED, p.query );
      |                                 ^~
libs/render.h:980:52: error: ‘GL_SAMPLES_PASSED’ was not declared in this scope
  980 |                                 gl().glBeginQuery( GL_SAMPLES_PASSED, p.query );
      |                                                    ^~~~~~~~~~~~~~~~~
libs/render.h:981:58: error: ‘GL_FLOAT’ was not declared in this scope
  981 |                                 gl().glVertexPointer( 3, GL_FLOAT, 0, &p.vertex );
      |                                                          ^~~~~~~~
libs/render.h:982:52: error: ‘m_mode’ was not declared in this scope
  982 |                                 gl().glDrawArrays( m_mode, 0, 1 );
      |                                                    ^~~~~~
libs/render.h: In member function ‘void RenderTextLabel::texAlloc(const char*, const Vector3&)’:
libs/render.h:1271:17: error: ‘gl’ was not declared in this scope
 1271 |                 gl().glGenTextures( 1, &tex );
      |                 ^~
libs/render.h: In member function ‘void RenderTextLabel::texFree()’:
libs/render.h:1279:25: error: ‘gl’ was not declared in this scope
 1279 |                         gl().glDeleteTextures( 1, &tex );
      |                         ^~
libs/render.h: In member function ‘virtual void RenderTextLabel::render(RenderStateFlags) const’:
libs/render.h:1285:25: error: ‘gl’ was not declared in this scope
 1285 |                         gl().glBindTexture( GL_TEXTURE_2D, tex );
      |                         ^~
libs/render.h:1285:45: error: ‘GL_TEXTURE_2D’ was not declared in this scope
 1285 |                         gl().glBindTexture( GL_TEXTURE_2D, tex );
      |                                             ^~~~~~~~~~~~~
libs/render.h:1304:39: error: ‘GL_QUADS’ was not declared in this scope
 1304 |                         gl().glBegin( GL_QUADS );
      |                                       ^~~~~~~~
In file included from plugins/entity/doom3group.cpp:45:
libs/pivot.h: In member function ‘virtual void RenderablePivot::render(RenderStateFlags) const’:
libs/pivot.h:262:17: error: ‘gl’ was not declared in this scope
  262 |                 gl().glVertexPointer( 3, GL_FLOAT, sizeof( PointVertex ), &m_vertices.data()->vertex );
      |                 ^~
libs/pivot.h:262:42: error: ‘GL_FLOAT’ was not declared in this scope
  262 |                 gl().glVertexPointer( 3, GL_FLOAT, sizeof( PointVertex ), &m_vertices.data()->vertex );
      |                                          ^~~~~~~~
libs/pivot.h:263:41: error: ‘GL_UNSIGNED_BYTE’ was not declared in this scope
  263 |                 gl().glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( PointVertex ), &m_vertices.data()->colour );
      |                                         ^~~~~~~~~~~~~~~~
libs/pivot.h:264:36: error: ‘GL_LINES’ was not declared in this scope
  264 |                 gl().glDrawArrays( GL_LINES, 0, m_vertices.size() );
      |                                    ^~~~~~~~
In file included from plugins/entity/doom3group.cpp:47:
plugins/entity/targetable.h: In constructor ‘RenderableTargetingEntities::RenderableTargetingEntities(const TargetingEntities&)’:
plugins/entity/targetable.h:325:57: error: ‘GL_LINES’ was not declared in this scope
  325 |                 : m_targets( targets ), m_target_lines( GL_LINES ){
      |                                                         ^~~~~~~~
In file included from plugins/entity/doom3group.cpp:56:
plugins/entity/curve.h: In member function ‘virtual void RenderableCurve::render(RenderStateFlags) const’:
plugins/entity/curve.h:43:17: error: ‘gl’ was not declared in this scope
   43 |                 gl().glDrawArrays( GL_LINE_STRIP, 0, GLsizei( m_vertices.size() ) );
      |                 ^~
plugins/entity/curve.h:43:36: error: ‘GL_LINE_STRIP’ was not declared in this scope
   43 |                 gl().glDrawArrays( GL_LINE_STRIP, 0, GLsizei( m_vertices.size() ) );
      |                                    ^~~~~~~~~~~~~
plugins/entity/curve.h:43:54: error: ‘GLsizei’ was not declared in this scope
   43 |                 gl().glDrawArrays( GL_LINE_STRIP, 0, GLsizei( m_vertices.size() ) );
      |                                                      ^~~~~~~
In file included from plugins/entity/doom3group.cpp:56:
plugins/entity/curve.h: In constructor ‘CurveEdit::CurveEdit(ControlPoints&, const SelectionChangeCallback&)’:
plugins/entity/curve.h:188:35: error: ‘GL_POINTS’ was not declared in this scope
  188 |                 m_controlsRender( GL_POINTS ),
      |                                   ^~~~~~~~~
In file included from plugins/entity/doom3group.cpp:42:
libs/render.h: In instantiation of ‘void pointvertex_gl_array(const PointVertex_t*) [with PointVertex_t = PointVertex]’:
libs/render.h:881:23:   required from here
libs/render.h:846:11: error: ‘gl’ was not declared in this scope
  846 |         gl().glColorPointer( 4, GL_UNSIGNED_BYTE, sizeof( PointVertex_t ), &array->colour );
      |         ~~^~
libs/render.h: In instantiation of ‘void pointvertex_gl_array(const PointVertex_t*) [with PointVertex_t = DepthTestedPointVertex]’:
libs/render.h:973:24:   required from here
libs/render.h:846:11: error: ‘gl’ was not declared in this scope
make: *** [Makefile:506: plugins/entity/doom3group.o] Error 1
Garux commented 1 year ago

QOpenGLFunctions_2_0 must be available from this inclusion https://github.com/Garux/netradiant-custom/blob/master/include/igl.h#L28 Might be about Qt configuration e.g. https://github.com/qt/qtbase/blob/17b542c2d2545924f4d36f6705352e5b2489aa10/src/opengl/qopenglfunctions_2_0.h#L20

ghost commented 1 year ago

Are you suggesting I edit the source code for my configuration?

Garux commented 1 year ago

I can't know exact solution from the given data, just pointing towards right direction. It looks like your Qt is configured either w/o openGL or with openGL ES. There may be -opengles and -desktop flavours of Qt package. Or can try to configure and build Qt with proper config on your own (if openGL 2.0 is supported in your system at all).

ghost commented 1 year ago

All of the files mentioned in the error log are in the libs folder, I might be missing OpenGL libs.

ghost commented 1 year ago

I think this guide helped my problem by faking the qt5-default package, as it no longer exists

Garux commented 1 year ago

So is issue solved? Installing qtbase5-dev worked flawlessly here in Ubuntu 22.10

ghost commented 1 year ago

Yes, the problem is solved, its either the guide listed above, or you are missing a dependencies in the instructions.