Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 153016 - freeglut can't open a window
Summary: freeglut can't open a window
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-10-27 11:07 UTC by Sam
Modified: 2009-05-06 14:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sam 2006-10-27 11:07:30 UTC
I am trying to write an OpenGL program, but I am getting this error with freeglut. It used to work with xorg 6 but it is not working xorg 7.

freeglut (./test): Unable to create direct context rendering for window 'test window'
This may hurt performane

*  media-libs/freeglut
      Latest version available: 2.4.0-r1
      Latest version installed: 2.4.0-r1
Comment 1 Donnie Berkholz (RETIRED) gentoo-dev 2006-10-27 15:37:35 UTC
More likely it's because you updated freeglut from 2.2 to 2.4 -- can you back it down?
Comment 2 Sam 2006-10-30 12:13:23 UTC
(In reply to comment #1)
> More likely it's because you updated freeglut from 2.2 to 2.4 -- can you back
> it down?
> 
From :http://www.mathematik.uni-dortmund.de/~goeddeke/gpgpu/tutorial.html#setupgl2

"Cg 1.5 combined with the precompiled freeglut that ships with certain Linus distributions somehow breaks "true offscreen rendering" since a totally meaningless empty window pops up. There are three workarounds: Live with it. Use "real GLUT" instead of freeglut. Use plain X as described in the OpenGL.org wiki (just leave out the mapping of the created window to avoid it being displayed)."

--I am going with "not free" GLUT, and that seems to work.
Comment 3 Donnie Berkholz (RETIRED) gentoo-dev 2006-10-30 13:20:18 UTC
Yes, that works, but it sure doesn't fix the actual bug -- which is that freeglut can't get a direct rendering context for some reason.
Comment 4 Sam 2006-10-31 14:18:38 UTC
(In reply to comment #3)
> Yes, that works, but it sure doesn't fix the actual bug -- which is that
> freeglut can't get a direct rendering context for some reason.
> 

Okay, this is a complete n00b question, but how do I emerge a specific version?  

I added =media-libs/freeglut-2.2 ~amd64 to my package.keywords file, but it is still trying to merge 2.4
Comment 5 Joshua Baergen (RETIRED) gentoo-dev 2006-10-31 18:43:31 UTC
(In reply to comment #4)
> Okay, this is a complete n00b question, but how do I emerge a specific version? 
> 
> I added =media-libs/freeglut-2.2 ~amd64 to my package.keywords file, but it is
> still trying to merge 2.4
> 

'emerge -1 =media-libs/freeglut-2.2*' will install it, though it will be lost the next update.
Comment 6 Donnie Berkholz (RETIRED) gentoo-dev 2006-10-31 18:51:21 UTC
To keep it, add >=media-libs/freeglut-2.4 to /etc/portage/package.mask.
Comment 7 Sam 2006-11-01 07:00:32 UTC
(In reply to comment #5)
> (In reply to comment #4)
> > Okay, this is a complete n00b question, but how do I emerge a specific version? 
> > 
> > I added =media-libs/freeglut-2.2 ~amd64 to my package.keywords file, but it is
> > still trying to merge 2.4
> > 
> 
> 'emerge -1 =media-libs/freeglut-2.2*' will install it, though it will be lost
> the next update.
> 

freeglut 2.2 is not compiling

gcc -DHAVE_CONFIG_H -I. -I. -I.. -march=nocona -O2 -pipe -c freeglut_cursor.c -MT libglut_la-freeglut_cursor.lo -MD -MP -MF .deps/libglut_la-freeglut_cursor.TPlo -o libglut_la-freeglut_cursor.o >/dev/null 2>&1
freeglut_callbacks.c: In function 'glutDisplayFunc':
freeglut_callbacks.c:54: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutReshapeFunc':
freeglut_callbacks.c:63: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutKeyboardFunc':
freeglut_callbacks.c:72: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutSpecialFunc':
freeglut_callbacks.c:80: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutVisibilityFunc':
freeglut_callbacks.c:143: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutKeyboardUpFunc':
freeglut_callbacks.c:157: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutSpecialUpFunc':
freeglut_callbacks.c:165: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutJoystickFunc':
freeglut_callbacks.c:175: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutMouseFunc':
freeglut_callbacks.c:190: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutMouseWheelFunc':
freeglut_callbacks.c:198: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutMotionFunc':
freeglut_callbacks.c:207: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutPassiveMotionFunc':
freeglut_callbacks.c:216: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutEntryFunc':
freeglut_callbacks.c:224: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutCloseFunc':
freeglut_callbacks.c:232: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutOverlayDisplayFunc':
freeglut_callbacks.c:270: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutWindowStatusFunc':
freeglut_callbacks.c:278: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutSpaceballMotionFunc':
freeglut_callbacks.c:286: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutSpaceballRotateFunc':
freeglut_callbacks.c:294: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutSpaceballButtonFunc':
freeglut_callbacks.c:302: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutButtonBoxFunc':
freeglut_callbacks.c:310: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutDialsFunc':
freeglut_callbacks.c:318: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutTabletMotionFunc':
freeglut_callbacks.c:326: error: invalid lvalue in assignment
freeglut_callbacks.c: In function 'glutTabletButtonFunc':
freeglut_callbacks.c:334: error: invalid lvalue in assignment
make[2]: *** [libglut_la-freeglut_callbacks.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
mv -f .libs/libglut_la-freeglut_display.lo libglut_la-freeglut_display.lo
mv -f .libs/libglut_la-freeglut_cursor.lo libglut_la-freeglut_cursor.lo
make[2]: Leaving directory `/var/tmp/portage/media-libs/freeglut-2.2.0/work/freeglut-2.2.0/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/media-libs/freeglut-2.2.0/work/freeglut-2.2.0'
make: *** [all] Error 2

!!! ERROR: media-libs/freeglut-2.2.0 failed.
Call stack:
  ebuild.sh, line 1568:   Called dyn_compile
  ebuild.sh, line 937:   Called src_compile
  ebuild.sh, line 608:   Called die

!!! emake failed
!!! If you need support, post the topmost build error, and the call stack if relevant.


Comment 8 Donnie Berkholz (RETIRED) gentoo-dev 2006-11-01 07:24:42 UTC
Switch back to gcc 3.4 if you still have it installed.
Comment 9 Sam 2006-11-01 07:57:29 UTC
(In reply to comment #8)
> Switch back to gcc 3.4 if you still have it installed.
> 

I only have gcc 4.1.1, is there a way to have both installed.  I used to do that on my Solaris box by just modifing path, making the one I wanted to use first.
Comment 10 Donnie Berkholz (RETIRED) gentoo-dev 2006-11-01 08:23:45 UTC
(In reply to comment #9)
> (In reply to comment #8)
> > Switch back to gcc 3.4 if you still have it installed.
> > 
> 
> I only have gcc 4.1.1, is there a way to have both installed.  I used to do
> that on my Solaris box by just modifing path, making the one I wanted to use
> first.

It's even easier on Gentoo. Just emerge =gcc-3*, and use gcc-config to switch between them.
Comment 11 Sam 2006-11-01 10:59:29 UTC
(In reply to comment #8)
> Switch back to gcc 3.4 if you still have it installed.
> 

Okay, it compiled with gcc 3.4.  The code seems to run ... at least it is not giving that error anymore.  The thing is that it is supposed to only create a pseudo window so it can do X free rendering/calculations, but it is actually creating windows.  Not free glut has the correct behavior of not creating a window.  

When I execute glTexImage2D() in my c code, it is producing and error.  When I execute glGetError(), returns 1 which is not any of the return values documented in OpenGL man pages.  Any ideas?
Comment 12 Donnie Berkholz (RETIRED) gentoo-dev 2006-11-01 11:30:59 UTC
(In reply to comment #11)
> Okay, it compiled with gcc 3.4.  The code seems to run ... at least it is not
> giving that error anymore.  The thing is that it is supposed to only create a
> pseudo window so it can do X free rendering/calculations, but it is actually
> creating windows.  Not free glut has the correct behavior of not creating a
> window.  

Guess it's a bug. Might be fixed in 2.4, but we've got the other blocker issue there.

> When I execute glTexImage2D() in my c code, it is producing and error.  When I
> execute glGetError(), returns 1 which is not any of the return values
> documented in OpenGL man pages.  Any ideas?

Not really, but I am a bit surprised this would be specific to freeglut and not glut.
Comment 13 Sam 2006-11-04 11:21:04 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > Okay, it compiled with gcc 3.4.  The code seems to run ... at least it is not
> > giving that error anymore.  The thing is that it is supposed to only create a
> > pseudo window so it can do X free rendering/calculations, but it is actually
> > creating windows.  Not free glut has the correct behavior of not creating a
> > window.  
> 
> Guess it's a bug. Might be fixed in 2.4, but we've got the other blocker issue
> there.
> 
> > When I execute glTexImage2D() in my c code, it is producing and error.  When I
> > execute glGetError(), returns 1 which is not any of the return values
> > documented in OpenGL man pages.  Any ideas?
> 
> Not really, but I am a bit surprised this would be specific to freeglut and not
> glut.
> 

The thing about glTexImage2D() had to do with my configuration set to do cpu rendering instead of using the gpu/nvidia drivers.  It was fixed by executing:

# eselect opengl set nvidia
Comment 14 Rémi Cardona (RETIRED) gentoo-dev 2009-05-06 14:19:32 UTC
Closing as per comment #13.

Thanks