OpenGL - error
Archives Forums/Linux Discussion/OpenGL - error
| ||
I get this error when trying to run any built opengl program with blitzmax in linux, and the program won't start: Executing:untitled2.debug /usr/bin/ld: warning: libstdc++.so.6, needed by /usr/X11R6/lib/libGLU.so, may conflict with libstdc++.so.5 X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 144 (GLX) Minor opcode of failed request: 5 (X_GLXMakeCurrent) Serial number of failed request: 45 Current serial number in output stream: 45 Process complete According to glxinfo, the nvidia driver is active and is hardware accelerated. Edit: It is a PCI Express Graphics card in case you were wondering Any ideas? I'm running Linux Kernel v2.6.12-18 (Mandriva 2006), Xorg v6.9.0-5.6, Nvidia driver and Kernel: v 1.0 8756 I'm not into opengl yet, just want to check if it works. Just building the program does not generate any error, it's when doing "build and run" this error appears. |
| ||
Do you get a fullscreen nvidia logo when you boot? By the looks of this you're in for a ride... |
| ||
Yes fullscreen logo on white background I have some experience with installing nvidia and ati drivers in linux. I can run opengl, enemy territory etc, quake 4, and so on. "Driver" is set to "nvidia" in the XF86config (Xorg) config file, not "nv". I was using the sourcecode from http://www.blitzbasic.com/Community/posts.php?topic=42662 (I replaced the old stuff with the new ones (GLGraphics, etc)). This works: GLGraphics(800,600) init() While Not KeyDown(KEY_ESCAPE) display() Flip Wend End Function init() glClearColor(0.0, 0.0, 0.0, 0.0) glColor3f(0.0, 0.0, 1.0) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45.0, 800/600, 0.1, 100.0) End Function Function display() glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) glBegin(GL_TRIANGLES) glVertex3f( 0.0, 1.0,-10.0) glVertex3f(-1.0,-1.0,-10.0) glVertex3f( 1.0,-1.0,-10.0) glEnd() End Function This does not work in linux for me, it gave me the "major opcode GLX" error, but after replacing the GLgraphics line with "GLGraphics(GW,GH)" It now gives me a "appstub.linux signal handler 11" and the whole ide halts (although the same code works in win32): ' rem OPENGL spinnning cube by Bill Radford V1 Global GW:Int=800 Global GH:Int=600 Global angle:Float=0 Global mode = GL_QUADS Global msg:String GLGraphics(GW,GH,32) ' |BGL_FULLSCREEN) init() Repeat click_timer:-1 If click_timer < 0 Then click_timer = 0 If MouseDown(1) = 1 And click_timer = 0 glmode = glmode + 1 If glmode>6 Then glmode = 0 Select glmode Case 0 mode = GL_QUADS ; msg$ = "GL_QUADS" Case 1 mode = GL_LINES ; msg$ = "GL_LINES" Case 2 mode = GL_POLYGON ; msg$ = "GL_POLYGON" Case 3 mode = GL_TRIANGLES ; msg$ = "GL_TRIANGLES" Case 4 mode = GL_LINE_STRIP ; msg$ = "GL_LINE_STRIP" Case 5 mode = GL_LINE_LOOP ; msg$ = "GL_LINE_LOOP" Case 6 mode = GL_POINTS ; msg$ = "GL_POINTS" End Select click_timer = 50 EndIf frametimer(2) display(mode) idle_function() Flip Until KeyDown(KEY_ESCAPE) End Function init() glClearColor(0.0, 0.0, 0.0, 0.0) glClearDepth(1.0) glEnable(GL_CULL_FACE) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluPerspective(45.0, Float(GW)/Float(GH), 0.1, 100.0) glMatrixMode(GL_MODELVIEW) glLoadIdentity() End Function Function display(mode) glClear (GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT) glLoadIdentity() glTranslatef(0.0, 0.0, (Sin(angle)*10)-15) glRotatef(angle, 0.0, -1.0, 1.0) glBegin(mode) glColor3f(1.0,1.0,0.0) ' Front Face yellow glVertex3f(-1.0, -1.0, 1.0) glVertex3f( 1.0, -1.0, 1.0) glVertex3f( 1.0, 1.0, 1.0) glVertex3f(-1.0, 1.0, 1.0) glColor3f(0.0,1.0,0.0) ' Back Face Green glVertex3f(-1.0, -1.0, -1.0) glVertex3f(-1.0, 1.0, -1.0) glVertex3f( 1.0, 1.0, -1.0) glVertex3f( 1.0, -1.0, -1.0) glColor3f(1.0,0.0,0.0) ' Top Face Red glVertex3f(-1.0, 1.0, -1.0) glVertex3f(-1.0, 1.0, 1.0) glVertex3f( 1.0, 1.0, 1.0) glVertex3f( 1.0, 1.0, -1.0) glColor3f(0.0,0.0,1.0) ' Bottom Face Blue glVertex3f(-1.0, -1.0, -1.0) glVertex3f( 1.0, -1.0, -1.0) glVertex3f( 1.0, -1.0, 1.0) glVertex3f(-1.0, -1.0, 1.0) glColor3f(0.1,0.1,0.1) ' Right face Gray?? glVertex3f( 1.0, -1.0, -1.0) glVertex3f( 1.0, 1.0, -1.0) glVertex3f( 1.0, 1.0, 1.0) glVertex3f( 1.0, -1.0, 1.0) glColor3f(1.0,1.0,1.0) ' Left Face White glVertex3f(-1.0, -1.0, -1.0) glVertex3f(-1.0, -1.0, 1.0) glVertex3f(-1.0, 1.0, 1.0) glVertex3f(-1.0, 1.0, -1.0) glEnd() End Function Function idle_function() angle:+.1 If angle>360.0 angle=0.0 End Function Function frametimer(msecs) now = MilliSecs() Repeat passed = MilliSecs()-now Until passed > msecs End Function |
| ||
OMG.... Now it works.... Interesting.... I now noticed what was causing the crash... The .bmx files that i tried to compile did not have any write flags set. That made MaxIDE crash (appstub.linux signal handler 11) atleast here on my system. Snippet from console -r-xr-xr-x 1 kay kay 480 mai 18 23:38 gltest_triangle.bmx* -rwxrwxr-x 1 kay kay 2061617 mai 19 03:35 gltest_triangle.debug* -rw-rw-r-- 1 kay kay 379 mai 18 03:53 guitest1.bmx -rwxrwxr-x 1 kay kay 2061585 mai 19 03:29 guitest1.debug* -r-xr-xr-x 1 kay kay 2628 mai 18 23:38 spinning cube.bmx* -rwxrwxr-x 1 kay kay 2064033 mai 19 03:53 spinning cube.debug* [kay@unknown-u5tyqf3 work]$ chmod 0775 * [kay@unknown-u5tyqf3 work]$ ls -l totalt 6072 -rwxrwxr-x 1 kay kay 480 mai 18 23:38 gltest_triangle.bmx* -rwxrwxr-x 1 kay kay 2061617 mai 19 03:35 gltest_triangle.debug* -rwxrwxr-x 1 kay kay 379 mai 18 03:53 guitest1.bmx* -rwxrwxr-x 1 kay kay 2061585 mai 19 03:29 guitest1.debug* -rwxrwxr-x 1 kay kay 2628 mai 18 23:38 spinning cube.bmx* -rwxrwxr-x 1 kay kay 2064033 mai 19 03:53 spinning cube.debug* [kay@unknown-u5tyqf3 work]$ After changing write permissions MaxIDE does not crash, and the OpenGL application works :) |
| ||
Ouch, I haven't seen that before. Will tidy up MaxIDE writefile failure handling but any idea how those files became protected, did you unarchive the distro to somewhere in home or is it likely to be something else? |
| ||
I copied the sources from the ntfs partition ( /mnt/win_c/ ), so I guess that's why the write flags weren't set on those two files. |