Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile GLAD for GLES 2.0; redeclared as different kind of symbol #213

Closed
devvoid opened this issue Jun 1, 2019 · 8 comments
Closed

Comments

@devvoid
Copy link

devvoid commented Jun 1, 2019

Trying to compile a simple OpenGL application with GLAD, but I get a ton of warnings about things being "redeclared as a different kind of symbol".

Here are my settings on the online generator:

Language: C/C++
GL: None
GLES1: None
GLES2: 2.0
GLSC2: None
Specification: OpenGL
Profile: Compatability
No extensions.
Generate a Loader is checked, the other two checkboxes are not.

This happens with a completely empty main.c that does nothing but #include "glad/glad.h" and immediately return 0;. Replacing the ES 2.0 version with 3.3 causes it to compile perfectly.

@Dav1dde
Copy link
Owner

Dav1dde commented Jun 1, 2019

I can't reproduce this.

image

@devvoid
Copy link
Author

devvoid commented Jun 1, 2019

Here's a minimal reproduction of the issue:

glad.zip

@Dav1dde
Copy link
Owner

Dav1dde commented Jun 1, 2019

I still cannot reproduce the issue with your build.

image

image

Please share the complete command you're using to compile and all files.

@devvoid
Copy link
Author

devvoid commented Jun 1, 2019

I'm using the included makefile from the zip I uploaded. GCC version is 7.4.0

@devvoid
Copy link
Author

devvoid commented Jun 1, 2019

Here's the full error log I get from trying to build, putting it in a text file because it's pretty long.

errorlog.txt

@devvoid
Copy link
Author

devvoid commented Jun 1, 2019

After some additional experimentation, I think I've found the actual issue. It seems like including GLAD, and then including GLFW/glfw3.h immediately afterwards is what causes this to happen. If I include one or the other, it works fine.

@Dav1dde
Copy link
Owner

Dav1dde commented Jun 1, 2019

That's to be expected, glfw includes the gl headers by default. See: https://www.glfw.org/docs/latest/build.html#build_include and define GLFW_INCLUDE_NONE before including glfw.

@devvoid
Copy link
Author

devvoid commented Jun 1, 2019

That worked, thanks for the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants