[swift-users] Swift can’t compile code with OpenGL function pointers
eliacereda at gmail.com
Thu Mar 30 10:56:06 CDT 2017
Do you mind sharing the code you’re using? I’m looking back at some code I wrote a while back to learn OpenGL and I see that the implementation was pretty straightforward.
The OpenGL.GL module already provides the implementations for runtime functions such as glEnable, glBlendFunc and glClearColor. In my code I just import that and use those functions the same way you use any other function.
> Il giorno 30 mar 2017, alle ore 16:47, Kelvin Ma via swift-users <swift-users at swift.org> ha scritto:
> OpenGL functions are loaded at runtime by a function loader (like GLFW). They’re defined in a header but obviously they don’t have definitions at compile time so it causes a slew of linker errors when I try to build
> error: undefined reference to 'glEnable'
> error: undefined reference to 'glBlendFunc'
> error: undefined reference to 'glClearColor'
> clang: error: linker command failed with exit code 1 (use -v to see invocation)
> How do I build programs that use OpenGL functions?
> swift-users mailing list
> swift-users at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-users