0.14 OpenGL under Linux miscompiles

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
hybrid

Post by hybrid »

pyrocrickett wrote:I attempted to apply the patch, but I got the following error:

Code: Select all

$ patch -p1 < ../patches/OpenGLGetProc.patch
patching file COpenGLDriver.cpp
Hunk #1 FAILED at 403.
1 out of 1 hunk FAILED -- saving rejects to file COpenGLDriver.cpp.rej
I ran it in my source/Irrlicht/ directory (my patches, obviously, are in my source/patches/ directory).
Well, patch is not very eloquent on reasons for failure. At least the invocation seems to be correct. I don't know the patch format used (-cr) since I usually use -Naur which gives a little more readable output. But it does not seem to find the correct part of the code to apply the patch to. Did you chage the code before?
brodo

Post by brodo »

hi,
if i try to apply the patch i get several errors:

Code: Select all

patch unexpectedly ends in middle of line
patching file COpenGLDriver.cpp
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 403.
1 out of 1 hunk FAILED -- saving rejects to file COpenGLDriver.cpp.rej
i also ran it in the /source/irrlicht dir.
brodo

Post by brodo »

ok, edited the file manually and now it works!
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

brodo, could you tell me which lines of the patch you changed to get it to work?

also, where you placed the file and which command you used in the shell?

in other words.... everything!!! :wink: I also got this bug and I need to fix it in Linux ASAP.

help!

Code: Select all

patch unexpectedly ends in middle of line
patching file COpenGLDriver.cpp
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 403.
1 out of 1 hunk FAILED -- saving rejects to file COpenGLDriver.cpp.rej
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

or, which of Hybrid's patches on his site will fix this problem?
http://parsys.informatik.uni-oldenburg. ... /irrlicht/
hybrid

Post by hybrid »

I don't have it in my collection. I could not test it and we did not find a solution for all cases. I made an attempt to combine my previous patches with those from this thread but I was not very confident in their portability.
So we're still searching for a final solution which correctly recognizes the OpenGL library capabilities for ATI and nVidia under Linux! Comments are welcome.
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

Thanks for replying Hybrid! :wink: That would be great.

Ironically, I had no problems compiling Irrlicht on linux on my laptop (suse10-ATI graphics), but had the opengl issue on my desktop with nvidia. As a matter of fact, I've always had problems compiling Irrlicht under linux with Nvidia, and its always the "glXGetProcAddress" thingie.

Please let us know if you guys succeed on hunting this bug down. :wink:
terefang
Posts: 48
Joined: Tue Jun 21, 2005 9:56 am

Post by terefang »

IHMO my patch should work with all of Mesa/nVidia/ATI, yet i could only verify this against Mesa and nVidia since i have no ATI hardware available.

cheers,
terefang
nVidia 7800GT/256, AMD64-X2 4k2, Latest Fedora/CentOS
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

thnx Terefang. I'm trying it out with an Nvidia card but it doesn't seem to work. i get the error I reported above.

this is what I'm doing:
1. Copy your code into a text file. Rename it to "patch" or "gl.patch"
2. Open a shell and type in: "patch -p1 < patch" or "patch -p1 < gl.patch"
3. get the error.

someone mentioned editing some lines in your patch. Any ideas which lines they should be?
terefang
Posts: 48
Joined: Tue Jun 21, 2005 9:56 am

Post by terefang »

afecelis wrote:thnx Terefang. I'm trying it out with an Nvidia card but it doesn't seem to work. i get the error I reported above.

this is what I'm doing:
1. Copy your code into a text file. Rename it to "patch" or "gl.patch"
2. Open a shell and type in: "patch -p1 < patch" or "patch -p1 < gl.patch"
3. get the error.

someone mentioned editing some lines in your patch. Any ideas which lines they should be?
you could edit the irrlicht source file directly by finding the following codeblock around line 403:

Code: Select all

#ifdef GLX_VERSION_1_4
  #define IRR_OGL_LOAD_EXTENSION glXGetProcAddress
  #else
  #define IRR_OGL_LOAD_EXTENSION glXGetProcAddressARB
#endif
and change it to:

Code: Select all

#ifndef GLX_ARB_get_proc_address
  #define IRR_OGL_LOAD_EXTENSION glXGetProcAddress
  #else
  #define IRR_OGL_LOAD_EXTENSION glXGetProcAddressARB
#endif
terefang
nVidia 7800GT/256, AMD64-X2 4k2, Latest Fedora/CentOS
afecelis
Admin
Posts: 3075
Joined: Sun Feb 22, 2004 10:44 pm
Location: Colombia
Contact:

Post by afecelis »

yippee! thnx Terefang! :D

That's how I used to patch it; directly in the cpp file. It works beautifully! I'm saving this patch in a safe! :wink:
XAngel
Posts: 4
Joined: Mon Feb 06, 2006 9:07 pm
Location: Mafra, SC / Brasil
Contact:

Other error.

Post by XAngel »

Hi!

I am having other mistake after applying the patch for the problem with COpenGLDriver.cpp, see what happens:

Code: Select all

g++ -L/home/xangel/.libs/irrlicht/lib/Linux -L/usr/X11R6/lib -oSoul ./main.o -lIrrlicht -lX11 -lXxf86vm -ljpeg -lz -lGL
/home/xangel/.libs/irrlicht/lib/Linux/libIrrlicht.a(COpenGLTexture.o): In function `irr::video::COpenGLTexture::copyTexture()':
COpenGLTexture.cpp:(.text+0x85a): undefined reference to `gluBuild2DMipmaps'
COpenGLTexture.cpp:(.text+0x86e): undefined reference to `gluErrorString'
Can anybody help myself?
hybrid

Post by hybrid »

Link with -lGLU -lGL instead of just -lGL MipMapGeneration is located in the OpenGL utilities library.
XAngel
Posts: 4
Joined: Mon Feb 06, 2006 9:07 pm
Location: Mafra, SC / Brasil
Contact:

Post by XAngel »

hybrid wrote:Link with -lGLU -lGL instead of just -lGL MipMapGeneration is located in the OpenGL utilities library.
Thanks!
:roll:
Guest

Post by Guest »

Hi,
I applied successfully the patch and then I compiled the lib and evrything gone fine.
But when I try to compile examples I get an error

Code: Select all

g++ main.cpp -o example -I"../../include" -I"/usr/X11R6/include" -L"/usr/X11R6/lib" -L"../../lib/Linux" -lIrrlicht -lGL -lGLU -lXxf86vm -lXext -lX11
../../lib/Linux/libIrrlicht.a(COpenGLDriver.o): dans la fonction « irr::video::COpenGLDriver::loadExtensions()    »:
COpenGLDriver.cpp:(.text+0xa4b): référence indéfinie vers « glXGetProcAddress »
COpenGLDriver.cpp:(.text+0xa61): référence indéfinie vers « glXGetProcAddress »
COpenGLDriver.cpp:(.text+0xa77): référence indéfinie vers « glXGetProcAddress »
COpenGLDriver.cpp:(.text+0xa8d): référence indéfinie vers « glXGetProcAddress »
COpenGLDriver.cpp:(.text+0xaa3): référence indéfinie vers « glXGetProcAddress »
../../lib/Linux/libIrrlicht.a(COpenGLDriver.o):COpenGLDriver.cpp:(.text+0xab9): encore plus de références indéfinies suivent vers « glXGetProcAddress »
collect2: ld a retourné 1 code d'état d'exécution
make: *** [all] Erreur 1
I've a nvidia card.

I saw many posts talking about it on the forum but nothing worked for me.
I've all the latest libs mentioned in the threads and I cant solve the problem.

If some guru here can help me...
thanks a lot.
Post Reply