Lets say I have an extern function pointer in a header file
extern void (__stdcall * const glEnable) (GLenum cap);
is there a way to define it inside a function, because its definition depends on other stuff
void glInit()
{
...
Lib lib = loadLib("opengl");
glEnable = procAddr(lib, "glEnable");
...
}
to define it inside a functionNo it is not possible - symbols declared at file scope have to be defined at file scope. I do not believe such an answer solves your real underlying problem in any way... are you asking an XY question?