Hi,
I am trying to compile and run some of my new code on my old laptop. My current code was developed on a GL 4-capable machine, and uses several key extensions that are not supported on the older device.
When building on the newer machine, it works perfectly. When building on the older machine, despite a nearly identical build chain, it fails with linker errors. Specifically, some GLEW functions are referenced as undefined. I am linking against the library, in the same place as the working build, and, incidentally, last in the linker order. The undefined functions include __glewUniform1D and __glewBindImageTextureEXT. Such functions come from extensions (in those cases, GL_ARB_gpu_shader_fp64 and GL_ARB_shader_image_load_store, repsectively)--notably extensions that the older laptop doesn't list as supported.
I have an extremely fuzzy conception of how GLEW actually works, but since other GLEW functions (e.g. glewInit) are not listed as undefined, I draw the conclusion that perhaps the extensions don't exist and so can't be linked to. Though, since the library versions of GLEW are the same (1.5) and I can't think of a mechanism besides, I can't be sure.
However, it also gives rise to another idea. Since the extensions aren't supported anyway, it would be convenient to be able to remove code that won't work at compile time. Though, since GPU detection, I expect, can only be done at runtime, I don't see how that could work.
So: why the linker errors? And, can extensions be checked at compile-time?
Thanks,
-G