Strange OpenGL error when compiling Source

Strange OpenGL error when compiling Source

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Toby
Posts: 3
Joined: 16 Nov 2016, 10:39

Strange OpenGL error when compiling Source

Post by Toby »

Hi, I'm rather new to Linux so it could be something I'm doing wrong (and most likely is), but when I compile the source after downloading all the required libs I get this error after compiling for a while:
/home/toby/Documents/TASpringSource/spring_103.0/rts/Rendering/GlobalRendering.cpp: In member function ‘void CGlobalRendering::PostInit()’:
/home/toby/Documents/TASpringSource/spring_103.0/rts/Rendering/GlobalRendering.cpp:240:17: error: ‘GL_MAX_UNIFORM_BUFFER_BINDINGS’ was not declared in this scope
glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, &glslMaxUniformBufferBindings);
^
/home/toby/Documents/TASpringSource/spring_103.0/rts/Rendering/GlobalRendering.cpp:241:17: error: ‘GL_MAX_UNIFORM_BLOCK_SIZE’ was not declared in this scope
glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, &glslMaxUniformBufferSize);
^
rts/builds/legacy/CMakeFiles/engine-legacy.dir/build.make:4958: recipe for target 'rts/builds/legacy/CMakeFiles/engine-legacy.dir/__/__/Rendering/GlobalRendering.cpp.o' failed
make[3]: *** [rts/builds/legacy/CMakeFiles/engine-legacy.dir/__/__/Rendering/GlobalRendering.cpp.o] Error 1
CMakeFiles/Makefile2:4101: recipe for target 'rts/builds/legacy/CMakeFiles/engine-legacy.dir/all' failed
make[2]: *** [rts/builds/legacy/CMakeFiles/engine-legacy.dir/all] Error 2
CMakeFiles/Makefile2:3922: recipe for target 'rts/builds/CMakeFiles/spring.dir/rule' failed
make[1]: *** [rts/builds/CMakeFiles/spring.dir/rule] Error 2
Makefile:1070: recipe for target 'spring' failed
make: *** [spring] Error 2
I haven't touched the source code at all and I just wanted to compile it. It seems to complain about some opengl functions that are not declared properly. I'm using Xubuntu. Which has to have OpenGL since what other option is there, right? Some help would be greatly appreciated since I have no idea how to fix this.
User avatar
ThinkSome
Posts: 387
Joined: 14 Jun 2015, 13:36

Re: Strange OpenGL error when compiling Source

Post by ThinkSome »

You are most likely missing headers for OpenGL. I'd look at some spring compile guide and install the additional packages that might be mentioned there.
hokomoko
Spring Developer
Posts: 593
Joined: 02 Jun 2014, 00:46

Re: Strange OpenGL error when compiling Source

Post by hokomoko »

Toby
Posts: 3
Joined: 16 Nov 2016, 10:39

Re: Strange OpenGL error when compiling Source

Post by Toby »

Thanks for the help. I completely forgot about this post, ergo my absence. (Was waiting for an email telling me that the thread was approved :P ) We'll give it another try compiling but I figured all OpenGL related headers would already be included with my Linux Distro.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Strange OpenGL error when compiling Source

Post by Kloot »

Your distro's version of GLEW is probably out of date, as is...
/home/toby/Documents/TASpringSource/
the directory naming convention you have chosen.
Toby
Posts: 3
Joined: 16 Nov 2016, 10:39

Re: Strange OpenGL error when compiling Source

Post by Toby »

Didn't realize the name of the folder could mess things up. Figured it would be fine as long as you don't have spaces. What is the problem exactly? :P
We managed to compile it on another computer running the same distro in a virtual box (fresh install). So I'm unsure as to what the cause for the problem is.
gajop
Moderator
Posts: 3051
Joined: 05 Aug 2009, 20:42

Re: Strange OpenGL error when compiling Source

Post by gajop »

Kloot wrote:
/home/toby/Documents/TASpringSource/
the directory naming convention you have chosen.
Toby wrote:Didn't realize the name of the folder could mess things up. Figured it would be fine as long as you don't have spaces. What is the problem exactly? :P
There is no technical issue with that, except this project hasn't been called TASpring in a long while.



To expand on the original problem, I had the same issue on Ubuntu 16.04, as it's using glew 1.13.0 (libglew-dev/xenial,now 1.13.0-2 amd64 [installed]). I've a feeling we should put some effort to support it, as it's a popular platform (maybe our include/GL/glew.h is out of date?). This issue is related to viewtopic.php?t=32428, although archlinux has probably moved to glew 2.0 since.

Glew 2.0 is in Ubuntu testing (https://launchpad.net/ubuntu/+source/glew) and it has binaries available at:
https://launchpad.net/ubuntu/+source/gl ... d/11117458
Once you downloaded them (seems you only need these 3), they can then be installed with:

Code: Select all

sudo dpkg -i  glew-utils_2.0.0-3_amd64.deb libglew-dev_2.0.0-3_amd64.deb libglew2.0_2.0.0-3_amd64.deb
You should then delete the cmake generated files and make new ones. After you've configured the project you should set GLEW_LIBRARIES to the newly installed glew: /usr/lib/x86_64-linux-gnu/libGLEW.so.2.0

Then it will compile. Running it, I still had some issues with ArchiveScan (https://springrts.com/mantis/view.php?id=5415), and you can see them in infolog-ubuntu.txt in that report.
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Strange OpenGL error when compiling Source

Post by Kloot »

Our include/GL/glew.h *is* ancient, but only used by the headless build and not relevant here.
Post Reply

Return to “Engine”