glut problem on Fedora Core 5 and solution

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

glut problem on Fedora Core 5 and solution

Herbert Fruchtl
Here is a problem and its solution. I am just reporting it so it can be
integrated into the next release. It may even warrant a release; at
least I found it pretty annoying.

The problem: On Fedora Core 5 x86_64 (I don't know if it also happens on
32-bit platforms), the program compiles and links OK. If you right-click
an atom to select it, the program crashes with the following error:

freeglut  ERROR:  Function <glutBitmapCharacter> called without first
calling 'glutInit'.

Apparently, in the latest versions of freeglut (2.4 and up), glutInit
has to be called first.

The changes I made are:

In xmakemol.c:
- Add a prototype
        void glutInit(int *argcp, char **argv);
(I guess it would be cleaner to include glut.h or freeglut.h)
- add a call to this function early in main().

In Makefile:
- add -lglut to the flags in xmakemol_LDADD

I leave figuring out the proper #ifdefs and the exact location where the
function call should go to the authors.

Cheers,

   Herbert
--
Herbert Fruchtl
EaStCHEM Fellow
School of Chemistry
University of St Andrews



_______________________________________________
XMakemol-bugs mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/xmakemol-bugs
Reply | Threaded
Open this post in threaded view
|

Re: glut problem on Fedora Core 5 and solution

Matt Hodges-2
>>>>> Herbert Fruchtl writes:

 > Here is a problem and its solution. I am just reporting it so it
 > can be integrated into the next release. It may even warrant a
 > release; at least I found it pretty annoying.

 > The problem: On Fedora Core 5 x86_64 (I don't know if it also
 > happens on 32-bit platforms), the program compiles and links OK. If
 > you right-click an atom to select it, the program crashes with the
 > following error:

 > freeglut ERROR: Function <glutBitmapCharacter> called without first
 > calling 'glutInit'.

 > Apparently, in the latest versions of freeglut (2.4 and up),
 > glutInit has to be called first.

 > The changes I made are:

 > In xmakemol.c: - Add a prototype void glutInit(int *argcp, char
 > **argv); (I guess it would be cleaner to include glut.h or
 > freeglut.h) - add a call to this function early in main().

The call to glutInit has already been added to the CVS xmakemol.c
source.

 > In Makefile: - add -lglut to the flags in xmakemol_LDADD

This should be handled by ./configure (works for me).

 > I leave figuring out the proper #ifdefs and the exact location
 > where the function call should go to the authors.

I'm afraid I haven't had time to produce a release including this fix.

Thanks,

Matt


_______________________________________________
XMakemol-bugs mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/xmakemol-bugs