andersonfreitas / opengl-boilerplate

A cross-platform boilerplate project for OpenGL using GLFW and GLEW in C++
55 stars 16 forks source link

Redefinition errors #2

Open ackoujens opened 8 years ago

ackoujens commented 8 years ago

I'm going to leave this here in the hope of being answered.

I cloned your project and followed the instructions but when I open this up in Xcode I get a load of redefinition errors. These are being caused by glew (I left an issue report there also).

If you in any case know what this may be causing, please let me know.

Working on a macbook pro using El Capitan

andersonfreitas commented 8 years ago

Could you share the error log?

ackoujens commented 8 years ago

Here is a zip file with my Xcode error log and the altered glew.c file. I commented out the redefinitions and the compilation all went well. glew.zip

What's bothering me is that it normally wouldn't be necessary to do this and it should all work out of the box in my opinion.

nigels-com commented 8 years ago

I did some troubleshooting for this on Linux. See: https://github.com/nigels-com/glew/issues/66

The easy fix to advance external/glew to version 1.13.0, rather than 1.10.0. The longer story is that glew itself is using a git repository of the OpenGL specs, but the default behavior by GLEW is to use the latest version of the specs, not those that corresond to 1.10.0 (and work!).

I'll file a merge request or two for opengl-boilerplate.

Nice project, BTW, I think I'll start using this, now I know about it!

-- Nigel

nigels-com commented 8 years ago

For what it's worth, my opinion is that it would be wiser for opengl-boilerplate to use a numbered release for both the glew and glfixes repositories (for a pre-generated snapshot from a .tgz) rather than top-of-tree of either of those.

-- Nigel

ackoujens commented 8 years ago

Yeah pulling in the submodules seems like a good idea but when either of those change, it could break the project like in this case. Glad you found what the issue was. Chopping away the redefs was a pain in the ass.

nigels-com commented 8 years ago

GLEW can share some of the blame for this. GLEW itself it using git to track the OpenGL specifications, but is fetching the most recent version by default, which is normally what's expected. I'll educate myself some more about submodules, and if GLEW ought to use that rather than Makefile scripting.

andersonfreitas commented 8 years ago

Hi @nigels-com, thank you for checking this out. Going to merge your PR tonight :+1:

SamDeakin commented 7 years ago

I'm experiencing an error with a similar cause on OSX. Using the currently pinned version of glew causes make to fail while building glew because of an unknown type, PFNGLGETVKPROCADDRNVPROC. Updating glew to 2.0.0 appears to fix this issue.

Tsarpf commented 7 years ago

My build fails because of PFNGLGETVKPROCADDRNVPROC as well on OSX. Though updating glew to 2.0 doesn't fix it for me. Weird?

Tsarpf commented 7 years ago

Okay now it worked after following the steps here https://github.com/nigels-com/glew/issues/66#issuecomment-169976941. I guess I hadn't cleared some cache entirely.