Fortran bindings fail on glfwCreateWindow

dpyc99 wrote on Wednesday, January 27, 2016:

I am attempting to create a set of Fortran bindings for GLFW3. I am able to compile on Windows 10/MinGW, but execution fails when I try to create a window. The same code written in C and using the same libraries works properly. When I execute the program I get a backtrace of 6f6104fe/6f6913eb/004010f8. I have also tried this using the f03gl package with identical results. I’m beginning to wonder if there’s some kind of incompatibility between gfortran and opengl32. Any thoughts? And thanks in advance.
– Dick

I’ve done this myself and all is running fine. I’ve ported just about everything and can make the bindings available at some point. It’s in Windows/MinGW currently but will also do Ubuntu soon.

I’ve also put together a Font engine as well for use from the Fortran side of things.

Greetings. This thread is old, but maybe someone would look for something similar, so I could add my bit.

I am using GLFW in Fortran programs for quite some time now, using custom bindings for GLFW, OpenGL, OpenAL, and other libraries. I have to say it works flawlessly, both on Linux and on Windows. Note that I use gfortran for that (on Windows this is done using the TDM-GCC compiler suite).
I did extensive tests with test programs written in Fortran and C, and the results were exactly the same, both on screen and performance-wise.
Since it doesn’t work for you, if I were to guess, I’d say your bindings are probably buggy. Just a typo in the bindings, for example a GLFW constant with incorrect value could mess up everything. So I guess the first thing you have to do is to check your Fotran bindings implementation thoroughly.