Comments (6)
Thanks, I will take a look. I assume you're using it for the D programming language? Are you using the latest version I fixed a bug like that in the last commit.
from glad.
Can you give me some more information, I tried to reproduce this, but everything I try seems to compile, e.g.:
─[dav1d@archbox][~/workspaces/d/glad]╼ python2 main.py --out-path=./build --generator=d 1 ↵ ✭master
Using local spec: gl.xml
Generating gl bindings...
─[dav1d@archbox][~/workspaces/d/glad]╼ dmd -Ibuild build/glad/gl/* -L-ldl ✭master
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.0/../../../../lib/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: Fehler: ld gab 1 als Ende-Status zurück
--- errorlevel 1
The last error message means, there is simply no main
function, linking failed (expected), but compilation succeeded.
Can you give me the command you use to compile your code and the command which you used to generate the loader?
Thanks
from glad.
Ah, sorry about that.
I'm using the C binding actually, but with one important distinction: I'm compiling the resulting .c file as C++ instead of C. Apparently C doesn't care that there are multiple definitions of these things, but C++ is more strict.
The loader generator command:
python main.py --profile=compatibility --out-path=testloader --api="gl=" --generator=c --spec=gl
Then I rename testloader/src/glad.c to glad.cpp, and compile:
gcc testloader/src/glad.cpp -I./testloader/include
from glad.
The three last extensions are also written against plain OpenGL, so there's nothing wrong about them getting loaded:
https://www.opengl.org/registry/specs/EXT/geometry_shader4.txt
https://www.opengl.org/registry/specs/EXT/separate_shader_objects.txt
https://www.opengl.org/registry/specs/EXT/direct_state_access.txt
Concerning the compilation error you encounter, this is not valid C++ code. (3.2 One definition rule)
However, this is valid C code since those are all tentative definitions. (6.9.2 External object definitions)
Glad supplies a C binding that requires a C compiler. I see no bug.
Why would you want to compile it with a C++ compiler?
from glad.
With latest commit, C++ should be supported. My small tests run through and @pyalot uses it in a bigger C++ project.
from glad.
Ok now it is really fixed, thanks everyone!
from glad.
Related Issues (20)
- Is there an API to download platform specific headers and sources? HOT 2
- glad/egl.h is not generated
- GLX_*_ARB was not declared in scope HOT 2
- Glad.h missing HOT 1
- RFE: please start making github releases HOT 3
- GL_MAX_TEXTURE_COORDS missing HOT 2
- How to use Glad2? (gladLoadGL completely missing) HOT 6
- CMake glad_add_library(): REPRODUCIBLE keyword HOT 2
- Parsing extensions fails with Mesa and GLES2
- glad2 debug build recompiles every launch
- Surface related vk calls fail with an SDL-created Vulkan Surface (Vulkan 1.3)
- Provide cmake-package HOT 8
- [question] What heppened with the CMakeLists.txt file in the repository root? HOT 3
- glad_egl_find_core querying EGL_VERSION ahead of eglInitialize HOT 2
- <KHR/khrplatform.h> not found on OpenBSD, alpinelinux and others? HOT 14
- warning: 'GLAD_GLES2_USE_SYSTEM_EGL' is not defined, evaluates to 0 [-Wundef]
- Fail to use GL_NV_geometry_shader_passthrough bug. HOT 4
- GL/GLFW Example Displays GLAD Version "0.1" HOT 6
- Vulkan tests fail on 32bit x86 systems HOT 3
- GCC -fanalyzer report error when compiling glad
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from glad.