meeloo/nui

Compilation error on Linux: ‘glUseProgram’ was not declared

Opened this issue · 2 comments

/usr/lib/ccache/c++ -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DNGL_STATIC_BUILD -DXP_UNIX -D_DEBUG -D_LIB -D__LINUX__ -Dnui3_EXPORTS -fPIC -I/usr/include/Headers -I/home/wesley/WorkPlace/nui3/deps/freetype2/include -I/home/wesley/WorkPlace/nui3/deps/ucdata -I/home/wesley/WorkPlace/nui3/deps/harfbuzz -I/home/wesley/WorkPlace/nui3/deps/tracemonkey -I/home/wesley/WorkPlace/nui3/deps/tracemonkey/vprof -I/home/wesley/WorkPlace/nui3/deps/tracemonkey/nanojit -I/home/wesley/WorkPlace/nui3/deps/libcss/include -I/home/wesley/WorkPlace/nui3/include -I/home/wesley/WorkPlace/nui3/src/Stream/Zip -I/home/wesley/WorkPlace/nui3/src/Text/HTML -I/home/wesley/WorkPlace/nui3/. -I/home/wesley/WorkPlace/nui3/src/Application/Unix -I/home/wesley/WorkPlace/nui3/src/Window/Unix -O0 -g -std=c++11 -o CMakeFiles/nui3.dir/src/Renderers/nuiGLPainter.o -c /home/wesley/WorkPlace/nui3/src/Renderers/nuiGLPainter.cpp

In file included from /home/wesley/WorkPlace/nui3/include/ngl.h:501:0,
from /home/wesley/WorkPlace/nui3/include/nui.h:36,
from /home/wesley/WorkPlace/nui3/src/Renderers/nuiGLPainter.cpp:9:
/home/wesley/WorkPlace/nui3/include/nui_GL/glext.h:34:0: warning: "GL_GLEXT_VERSION" redefined [enabled by default]
#define GL_GLEXT_VERSION 70
^
In file included from /usr/include/GL/gl.h:2059:0,
from /home/wesley/WorkPlace/nui3/include/ngl.h:499,
from /home/wesley/WorkPlace/nui3/include/nui.h:36,
from /home/wesley/WorkPlace/nui3/src/Renderers/nuiGLPainter.cpp:9:
/usr/include/GL/glext.h:56:0: note: this is the location of the previous definition
#define GL_GLEXT_VERSION 20131212
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiGLPainter.cpp: In member function ‘void nuiGLPainter::ApplyState(const nuiRenderState&, bool)’:
/home/wesley/WorkPlace/nui3/src/Renderers/nuiGLPainter.cpp:486:40: error: ‘glUseProgram’ was not declared in this scope
glUseProgram(mpShader->GetProgram());
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiGLPainter.cpp: In member function ‘void nuiGLPainter::RenderArrayInfo::Rebind(nuiRenderArray*)’:
/home/wesley/WorkPlace/nui3/src/Renderers/nuiGLPainter.cpp:2093:33: error: ‘glGenBuffers’ was not declared in this scope
glGenBuffers(1, &mVertexBuffer);
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiGLPainter.cpp:2095:37: error: ‘glBindBuffer’ was not declared in this scope
glBindBuffer(GL_ARRAY_BUFFER, mVertexBuffer);


seems GL_GLEXT_PROTOTYPES not defined.

Indeed, I have added is to ngl.h just before including gl.h. Can you pull the change and let me know if the fix works?
fec53e2#diff-0d67bc40dbf0b9a72e6669a99becec44R495

Hi meeloo, this time error is:
/usr/lib/ccache/c++ -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DNGL_STATIC_BUILD -DXP_UNIX -D_DEBUG -D_LIB -D__LINUX__ -Dnui3_EXPORTS -fPIC -I/usr/include/Headers -I/home/wesley/WorkPlace/nui3/deps/freetype2/include -I/home/wesley/WorkPlace/nui3/deps/ucdata -I/home/wesley/WorkPlace/nui3/deps/harfbuzz -I/home/wesley/WorkPlace/nui3/deps/tracemonkey -I/home/wesley/WorkPlace/nui3/deps/tracemonkey/vprof -I/home/wesley/WorkPlace/nui3/deps/tracemonkey/nanojit -I/home/wesley/WorkPlace/nui3/deps/libcss/include -I/home/wesley/WorkPlace/nui3/include -I/home/wesley/WorkPlace/nui3/src/Stream/Zip -I/home/wesley/WorkPlace/nui3/src/Text/HTML -I/home/wesley/WorkPlace/nui3/. -I/home/wesley/WorkPlace/nui3/src/Application/Unix -I/home/wesley/WorkPlace/nui3/src/Window/Unix -O0 -g -std=c++11 -o CMakeFiles/nui3.dir/src/Renderers/AAPrimitives.o -c /home/wesley/WorkPlace/nui3/src/Renderers/AAPrimitives.cpp

In file included from /home/wesley/WorkPlace/nui3/include/ngl.h:502:0,
from /home/wesley/WorkPlace/nui3/include/nui.h:36,
from /home/wesley/WorkPlace/nui3/src/Renderers/AAPrimitives.cpp:12:
/home/wesley/WorkPlace/nui3/include/nui_GL/glext.h:34:0: warning: "GL_GLEXT_VERSION" redefined [enabled by default]
#define GL_GLEXT_VERSION 70
^
In file included from /usr/include/GL/gl.h:2059:0,
from /home/wesley/WorkPlace/nui3/include/ngl.h:500,
from /home/wesley/WorkPlace/nui3/include/nui.h:36,
from /home/wesley/WorkPlace/nui3/src/Renderers/AAPrimitives.cpp:12:
/usr/include/GL/glext.h:56:0: note: this is the location of the previous definition
#define GL_GLEXT_VERSION 20131212
^
/home/wesley/WorkPlace/nui3/src/Renderers/AAPrimitives.cpp: In function ‘void glAAGenerateAATex(float, float)’:
/home/wesley/WorkPlace/nui3/src/Renderers/AAPrimitives.cpp:324:96: error: ‘gluBuild2DMipmaps’ was not declared in this scope
gluBuild2DMipmaps(GL_TEXTURE_2D, GL_LUMINANCE_ALPHA, pdb, pdb, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, texture);
^
make[2]: *** [CMakeFiles/nui3.dir/src/Renderers/AAPrimitives.o] Error 1


gluBuild2DMipmaps was declared in 'glu.h', why commented # include <GL/glu.h>(include/ngl.h:501)?
I uncommented it, compilation passed but other errors occured as follow:

$ /usr/lib/ccache/c++ -DFT_CONFIG_OPTION_SYSTEM_ZLIB -DNGL_STATIC_BUILD -DXP_UNIX -D_DEBUG -D_LIB -D__LINUX__ -Dnui3_EXPORTS -fPIC -I/usr/include/Headers -I/home/wesley/WorkPlace/nui3/deps/freetype2/include -I/home/wesley/WorkPlace/nui3/deps/ucdata -I/home/wesley/WorkPlace/nui3/deps/harfbuzz -I/home/wesley/WorkPlace/nui3/deps/tracemonkey -I/home/wesley/WorkPlace/nui3/deps/tracemonkey/vprof -I/home/wesley/WorkPlace/nui3/deps/tracemonkey/nanojit -I/home/wesley/WorkPlace/nui3/deps/libcss/include -I/home/wesley/WorkPlace/nui3/include -I/home/wesley/WorkPlace/nui3/src/Stream/Zip -I/home/wesley/WorkPlace/nui3/src/Text/HTML -I/home/wesley/WorkPlace/nui3/. -I/home/wesley/WorkPlace/nui3/src/Application/Unix -I/home/wesley/WorkPlace/nui3/src/Window/Unix -O0 -g -std=c++11 -o CMakeFiles/nui3.dir/src/Renderers/nuiSoftwarePainter.o -c /home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp

In file included from /home/wesley/WorkPlace/nui3/include/ngl.h:502:0,
from /home/wesley/WorkPlace/nui3/include/nui.h:36,
from /home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:11:
/home/wesley/WorkPlace/nui3/include/nui_GL/glext.h:34:0: warning: "GL_GLEXT_VERSION" redefined [enabled by default]
#define GL_GLEXT_VERSION 70
^
In file included from /usr/include/GL/gl.h:2059:0,
from /home/wesley/WorkPlace/nui3/include/ngl.h:500,
from /home/wesley/WorkPlace/nui3/include/nui.h:36,
from /home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:11:
/usr/include/GL/glext.h:56:0: note: this is the location of the previous definition
#define GL_GLEXT_VERSION 20131212
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:215:58: error: no ‘void nuiSoftwarePainter::ReleaseCacheObject(void_)’ member function declared in class ‘nuiSoftwarePainter’
void nuiSoftwarePainter::ReleaseCacheObject(void_ pHandle)
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp: In member function ‘void nuiSoftwarePainter::DrawLine(const nuiRenderArray_, int, int)’:
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:401:37: error: cannot convert ‘nuiTexture_ const_’ to ‘nuiTexture_’ in initialization
nuiTexture* pTexture = mpState->mpTexture;
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:443:39: error: request for member ‘GetImage’ in ‘(nuiTexture const_)(&((nuiSoftwarePainter_)this)->nuiSoftwarePainter::.nuiPainter::mpState->nuiRenderState::mpTexture)’, which is of pointer type ‘nuiTexture* const’ (maybe you meant to use ‘->’ ?)
switch (mpState->mpTexture->GetImage()->GetPixelFormat())
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:451:39: error: request for member ‘GetImage’ in ‘(nuiTexture const_)(&((nuiSoftwarePainter_)this)->nuiSoftwarePainter::.nuiPainter::mpState->nuiRenderState::mpTexture)’, which is of pointer type ‘nuiTexture* const’ (maybe you meant to use ‘->’ ?)
switch (mpState->mpTexture->GetImage()->GetPixelFormat())
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:460:39: error: request for member ‘GetImage’ in ‘(nuiTexture const_)(&((nuiSoftwarePainter_)this)->nuiSoftwarePainter::.nuiPainter::mpState->nuiRenderState::mpTexture)’, which is of pointer type ‘nuiTexture* const’ (maybe you meant to use ‘->’ ?)
switch (mpState->mpTexture->GetImage()->GetPixelFormat())
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp: In member function ‘void nuiSoftwarePainter::DrawTriangle(const nuiRenderArray_, int, int, int)’:
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:611:37: error: cannot convert ‘nuiTexture_ const_’ to ‘nuiTexture_’ in initialization
nuiTexture* pTexture = mpState->mpTexture;
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:658:39: error: request for member ‘GetImage’ in ‘(nuiTexture const_)(&((nuiSoftwarePainter_)this)->nuiSoftwarePainter::.nuiPainter::mpState->nuiRenderState::mpTexture)’, which is of pointer type ‘nuiTexture* const’ (maybe you meant to use ‘->’ ?)
switch (mpState->mpTexture->GetImage()->GetPixelFormat())
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:666:39: error: request for member ‘GetImage’ in ‘(nuiTexture const_)(&((nuiSoftwarePainter_)this)->nuiSoftwarePainter::.nuiPainter::mpState->nuiRenderState::mpTexture)’, which is of pointer type ‘nuiTexture* const’ (maybe you meant to use ‘->’ ?)
switch (mpState->mpTexture->GetImage()->GetPixelFormat())
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:675:39: error: request for member ‘GetImage’ in ‘(nuiTexture const_)(&((nuiSoftwarePainter_)this)->nuiSoftwarePainter::.nuiPainter::mpState->nuiRenderState::mpTexture)’, which is of pointer type ‘nuiTexture* const’ (maybe you meant to use ‘->’ ?)
switch (mpState->mpTexture->GetImage()->GetPixelFormat())
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp: In member function ‘void nuiSoftwarePainter::DrawRectangle(const nuiRenderArray_, int, int, int, int)’:
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:832:37: error: cannot convert ‘nuiTexture_ const_’ to ‘nuiTexture_’ in initialization
nuiTexture* pTexture = mpState->mpTexture;
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:878:39: error: request for member ‘GetImage’ in ‘(nuiTexture const_)(&((nuiSoftwarePainter_)this)->nuiSoftwarePainter::.nuiPainter::mpState->nuiRenderState::mpTexture)’, which is of pointer type ‘nuiTexture* const’ (maybe you meant to use ‘->’ ?)
switch (mpState->mpTexture->GetImage()->GetPixelFormat())
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:886:39: error: request for member ‘GetImage’ in ‘(nuiTexture const_)(&((nuiSoftwarePainter_)this)->nuiSoftwarePainter::.nuiPainter::mpState->nuiRenderState::mpTexture)’, which is of pointer type ‘nuiTexture* const’ (maybe you meant to use ‘->’ ?)
switch (mpState->mpTexture->GetImage()->GetPixelFormat())
^
/home/wesley/WorkPlace/nui3/src/Renderers/nuiSoftwarePainter.cpp:895:39: error: request for member ‘GetImage’ in ‘(nuiTexture const_)(&((nuiSoftwarePainter_)this)->nuiSoftwarePainter::.nuiPainter::mpState->nuiRenderState::mpTexture)’, which is of pointer type ‘nuiTexture* const’ (maybe you meant to use ‘->’ ?)
switch (mpState->mpTexture->GetImage()->GetPixelFormat())
^