For a GUI project, we have a makefile which builds a library (.a) from all the .o files, which is then linked for each test.
When doing so, any function not used is thus not included in the executable. In order not to have to rebuild every test every time, we decided to switch to .so and use dynamic linking. This code uses OpenGL and glad.o (glad.c --> glad.o)
libgrail.so: undefined reference to `glad_glProgramBinary'
libgrail.so: undefined reference to `glad_glGetProgramBinary'
I had a glad.o, and not even sure how we got it. It has the above symbols defined, but it is not compiled with -fPIC and cannot be linked into the shared library.
When I build with glad.c, the resulting glad.o does NOT have the symbols
Looking at the header file glad.h
GLAPI PFNGLPROGRAMBINARYPROC glad_glProgramBinary;
#define glProgramBinary glad_glProgramBinary
These are called in compiling shaders.
So perhaps our source of glad.c is bad. I looked all over, and can find it in various opengl demos, but I do not understand where it really comes from.
I found this generator: https://glad.dav1d.de/
and generated code for OpenGL 3.3 (.c and .h) compiling that code has the same errors. So what version of glad.c should I get in order to correctly generate these symbols?