PDA

View Full Version : g77 -> OpenGL



02-27-2003, 10:58 AM
I need to access GL from fortran :=( .
I have the header fglut.h but not the
matching library file(s)
Thanks
Pat

zen
02-27-2003, 02:13 PM
I think the libraries should be the same as for C.After all g77 just makes the object code wich is linked against the libs by gcc,right?If the compiler(rather linker) can't find the libs try finding where they are(the libGL.* files) and adding the file to the linker command line like this: gcc -L/usr/X11R6/lib/GL(or whatever the path is) ...

02-28-2003, 07:05 AM
The problem is in linking - it
compiles fine but when I link,
it can't find
glutinit_ and glutnull_ .
(I'm linking with
-lglut -lGL -lGLU -L /usr/X11R6/lib -lGLx
all the gl type libraries I can find)

error message
/tmp/ccGukEzD.o (.text+0x7):
undefined reference to glutinit_

zen
02-28-2003, 12:12 PM
Well I can't find glutinit_ in libglut.so.3.7 either.Maybe you need special libs for fortran?Is there a fortran binding for glut?If so check the docs.

dorbie
03-07-2003, 11:29 AM
The documentation says GLUT has fortran bindings, although I've never used them.

This should be of interest:
http://www.opengl.org/developers/documentation/glut/spec3/node91.html

Basically you want to link to fglut, not glut.

You may need the glut source to build this.

emtomas
03-14-2003, 06:11 PM
I've been making progress in getting
g77 to work with OpenGL.
I found these glue routines on the web
and I selected the appropriate bindings
for g77. These files are fgl.c fglu.c and
fglut.c.
So far I can compile, link and execute
a small routine.
Anyone interested can email me for
the files at emtomas@att.net