PDA

View Full Version : Linux OpenGL demo compile issues



sqrt[-1]
08-09-2008, 05:03 PM
As mentioned in this thread:
http://www.opengl.org/discussion_boards/ubbthreads.php?ubb=showflat&Number=243051#Post243051

some people are having trouble compiling my OpenGL demo on Linux.
Can some other people try it out and see if you get errors - or perhaps point out where I am going wrong? (seem to be a problem with the extension headers?) I am using PCLinuxOS 2007 and do not seem to have any problems compiling. (other than initially missing some dev packages for compile headers)

http://lightindexed-deferredrender.googlecode.com/files/LightIndexedDeferredRendering1.2.zip

Should just be able to extract the zip - go to the DeferredLighting folder and type "make" on the command line.

Seth Hoffert
08-09-2008, 05:33 PM
I'm getting the GLvoid errors as well:



../Framework3/OpenGL/OpenGLExtensions.h:596: error: ‘<anonymous>’ has incomplete type
../Framework3/OpenGL/OpenGLExtensions.h:596: error: invalid use of ‘GLvoid’


I'm in Ubuntu and I have all of the necessary packages installed for developing with OpenGL, SDL, GLEW, GLUT, etc.

I'm using gcc 4.2.3.

dletozeun
08-10-2008, 04:15 AM
Yes I have the same errors using the same OS abd compiler. I don't understand what is in the OpenGLExtensions.h header file. At fist sight there are many lines that look like what is in the glext header file (APIENTRY...).

kosmi
08-10-2008, 04:54 AM
Ubuntu 8.04.1 32-bit. I can compile without problems FW3 Humus's demos (like Domino, etc).


milan@ubuntu:~/Desktop/DeferredLighting/DeferredLighting$ make
g++ -Wall -ansi -DLINUX -DNO_JPEG -mmmx `pkg-config --cflags --libs gtk+-2.0` -O2 -ffast-math App.cpp ../Framework3/Linux/LinuxBase.cpp ../Framework3/CPU.cpp ../Framework3/Platform.cpp ../Framework3/BaseApp.cpp ../Framework3/OpenGL/OpenGLApp.cpp ../Framework3/Config.cpp ../Framework3/Util/Tokenizer.cpp ../Framework3/Util/String.cpp ../Framework3/Renderer.cpp ../Framework3/OpenGL/OpenGLRenderer.cpp ../Framework3/OpenGL/OpenGLExtensions.cpp ../Framework3/Imaging/Image.cpp ../Framework3/Math/Vector.cpp ../Framework3/GUI/Widget.cpp ../Framework3/GUI/Button.cpp ../Framework3/GUI/Dialog.cpp ../Framework3/GUI/CheckBox.cpp ../Framework3/GUI/Slider.cpp ../Framework3/GUI/Label.cpp ../Framework3/GUI/DropDownList.cpp ../Framework3/Util/Model.cpp ../Framework3/Util/BSP.cpp -o DynamicBranching3 -L/usr/X11R6/lib -lGL -lXxf86vm -L/usr/lib -lpng
In file included from ../Framework3/OpenGL/OpenGLRenderer.h:20,
from ../Framework3/OpenGL/OpenGLApp.h:19,
from App.h:23,
from App.cpp:23:
../Framework3/OpenGL/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from App.cpp:23:
App.h: In member function ‘virtual char* App::getTitle() const’:
App.h:49: warning: deprecated conversion from string constant to ‘char*’
App.h: In constructor ‘App::App()’:
App.h:115: warning: ‘App::bitMaskLightPos’ will be initialized after
App.h:88: warning: ‘bool App::staticLightSceneSet’
App.cpp:59: warning: when initialized here
In file included from ../Framework3/Linux/../GUI/Widget.h:19,
from ../Framework3/Linux/../GUI/Button.h:19,
from ../Framework3/Linux/../GUI/Dialog.h:19,
from ../Framework3/Linux/../BaseApp.h:26,
from ../Framework3/Linux/LinuxBase.cpp:17:
../Framework3/Linux/../GUI/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/GUI/Widget.h:19,
from ../Framework3/GUI/Button.h:19,
from ../Framework3/GUI/Dialog.h:19,
from ../Framework3/BaseApp.h:26,
from ../Framework3/BaseApp.cpp:16:
../Framework3/GUI/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/OpenGL/OpenGLRenderer.h:20,
from ../Framework3/OpenGL/OpenGLApp.h:19,
from ../Framework3/OpenGL/OpenGLApp.cpp:16:
../Framework3/OpenGL/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
../Framework3/OpenGL/OpenGLApp.cpp: In member function ‘virtual bool OpenGLApp::initAPI()’:
../Framework3/OpenGL/OpenGLApp.cpp:383: warning: deprecated conversion from string constant to ‘char*’
../Framework3/OpenGL/OpenGLApp.cpp:414: error: no matching function for call to ‘Renderer::addFont(const char [29], const char [30])’
../Framework3/OpenGL/../Renderer.h:309: note: candidates are: FontID Renderer::addFont(const char*, const char*, SamplerStateID)
In file included from ../Framework3/Renderer.cpp:16:
../Framework3/Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/OpenGL/OpenGLRenderer.h:20,
from ../Framework3/OpenGL/OpenGLRenderer.cpp:16:
../Framework3/OpenGL/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
../Framework3/OpenGL/OpenGLRenderer.cpp: In constructor ‘OpenGLRenderer::OpenGLRenderer(Window, __GLXcontextRec*, Display*, int)’:
../Framework3/OpenGL/OpenGLRenderer.cpp:267: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:268: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:269: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:270: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:271: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:272: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:273: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:274: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:275: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:276: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:277: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:278: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:279: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:280: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp:281: error: invalid conversion from ‘GLvoid (*)(GLint, GLsizei, const void*)’ to ‘void*’
../Framework3/OpenGL/OpenGLRenderer.cpp: In member function ‘void OpenGLRenderer::setRenderTargetSize(TextureID, int, int)’:
../Framework3/OpenGL/OpenGLRenderer.cpp:561: warning: unused variable ‘depthBits’
../Framework3/OpenGL/OpenGLRenderer.cpp: In member function ‘virtual ShaderID OpenGLRenderer::addShader(const char*, const char*, const char*, int, int, int, const char*, const char*, const char*, const char**, int, uint)’:
../Framework3/OpenGL/OpenGLRenderer.cpp:698: error: ‘glUseProgram’ was not declared in this scope
../Framework3/OpenGL/OpenGLRenderer.cpp:713: error: ‘glGetActiveUniform’ was not declared in this scope
../Framework3/OpenGL/OpenGLRenderer.cpp:715: error: ‘GL_SAMPLER_2D_RECT_SHADOW’ was not declared in this scope
../Framework3/OpenGL/OpenGLRenderer.cpp:717: error: ‘glGetUniformLocation’ was not declared in this scope
../Framework3/OpenGL/OpenGLRenderer.cpp:718: error: ‘glUniform1i’ was not declared in this scope
../Framework3/OpenGL/OpenGLRenderer.cpp:735: error: ‘glGetUniformLocation’ was not declared in this scope
../Framework3/OpenGL/OpenGLRenderer.cpp: In member function ‘virtual void OpenGLRenderer::changeBlendState(BlendStateID)’:
../Framework3/OpenGL/OpenGLRenderer.cpp:1311: error: ‘glBlendFuncSeparate’ was not declared in this scope
../Framework3/OpenGL/OpenGLRenderer.cpp: In member function ‘virtual void OpenGLRenderer::drawPlain(Primitives, vec2*, uint, BlendStateID, DepthStateID, const vec4*)’:
../Framework3/OpenGL/OpenGLRenderer.cpp:1572: warning: missing braces around initializer for ‘FormatDesc’
../Framework3/OpenGL/OpenGLRenderer.cpp: In member function ‘virtual void OpenGLRenderer::drawTextured(Primitives, TexVertex*, uint, TextureID, SamplerStateID, BlendStateID, DepthStateID, const vec4*)’:
../Framework3/OpenGL/OpenGLRenderer.cpp:1595: warning: missing braces around initializer for ‘FormatDesc’
../Framework3/OpenGL/OpenGLRenderer.cpp:1595: warning: missing braces around initializer for ‘FormatDesc’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp:233: warning: deprecated conversion from string constant to ‘char*’
../Framework3/Imaging/Image.cpp: In member function ‘bool Image::convert(FORMAT)’:
../Framework3/Imaging/Image.cpp:2367: warning: dereferencing type-punned pointer will break strict-aliasing rules
../Framework3/Imaging/Image.cpp:2369: warning: dereferencing type-punned pointer will break strict-aliasing rules
In file included from ../Framework3/GUI/Widget.h:19,
from ../Framework3/GUI/Widget.cpp:16:
../Framework3/GUI/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/GUI/Widget.h:19,
from ../Framework3/GUI/Button.h:19,
from ../Framework3/GUI/Button.cpp:16:
../Framework3/GUI/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/GUI/Widget.h:19,
from ../Framework3/GUI/Button.h:19,
from ../Framework3/GUI/Dialog.h:19,
from ../Framework3/GUI/Dialog.cpp:16:
../Framework3/GUI/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/GUI/Widget.h:19,
from ../Framework3/GUI/CheckBox.h:19,
from ../Framework3/GUI/CheckBox.cpp:16:
../Framework3/GUI/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/GUI/Widget.h:19,
from ../Framework3/GUI/Slider.h:19,
from ../Framework3/GUI/Slider.cpp:16:
../Framework3/GUI/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/GUI/Widget.h:19,
from ../Framework3/GUI/Label.h:19,
from ../Framework3/GUI/Label.cpp:16:
../Framework3/GUI/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/GUI/Widget.h:19,
from ../Framework3/GUI/DropDownList.h:19,
from ../Framework3/GUI/DropDownList.cpp:16:
../Framework3/GUI/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
In file included from ../Framework3/Util/Model.h:21,
from ../Framework3/Util/Model.cpp:16:
../Framework3/Util/../Renderer.h:66: error: storage size of ‘constantTypeSizes’ isn't known
make: *** [rel] Error 1
milan@ubuntu:~/Desktop/DeferredLighting/DeferredLighting$

EDIT: My mistake - this is from LIDR-v1.1 :sleeping: (tried with 8.04 default g++-4.2.3 and also g++-3.4.6 = same results).
I'll try v1.2 later;).

Komat
08-10-2008, 06:48 AM
It compiles fine for me on Ubuntu 7.10 with g++ 4.1.3. It fails with the errors about GLvoid after I switched to the g++ 4.2.1.

Komat
08-10-2008, 07:04 AM
Based on how I understand this bug report (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9278) something like:



typedef void MyVoid ;
void function( MyVoid ) ; <- to indicate that the function has no parameters.

is allowed in C but not allowed in C++ so the newer version of the compiler does not allow that.

Seth Hoffert
08-10-2008, 07:15 AM
Removing the voids fixed it for me. Nice demo.

dletozeun
08-10-2008, 09:20 AM
Yes this works removing GLvoid. But the demo doesn't work correctly, I just see the lights bouncing but everything else is black and the window behaves oddly, actually keyboard and mouse don't respond for everything outside the demo. For instance, I can't move or resize the window, or take a screenshot until I quit pressing escape. :(

Seth Hoffert
08-10-2008, 09:31 AM
Weird, it works here. What driver/card are you using? I am using an 8800 GTS with NVIDIA's latest drivers.

dletozeun
08-10-2008, 10:35 AM
Oops I forgot it. ATI Radeon X1600 mobility and driver catalyst 8.51.3 which is the latest for my card.

sqrt[-1]
08-11-2008, 04:37 AM
Thanks heaps guys - I would never have found that compiler issue.

@ dletozeun
That "blackness" is what another X1600 user originally reported - did you try uncommenting the lines in the shader file (in my original post) and see if that made a difference?
(the lightIndex += 0.5/256.0; line in the file lightingLIDefer.shd)

dletozeun
08-11-2008, 02:11 PM
Oops sorry I forgot to try it with all of this...

With regrets, that did not help, I get the same rendering.

sqrt[-1]
08-11-2008, 07:33 PM
OK - thanks for all your help dletozeun - You went above the call of duty in helping me. Shame I cannot figure out what is wrong.

Seth Hoffert
08-29-2008, 08:31 PM
Just FYI, I am able to compile and run the demo in a 64-bit Vista environment.