Page 1 of 1

Make error: /usr/bin/ld: cannot find -lGL

Posted: Sat Nov 03, 2007 2:47 pm
by White_Wolf
I've been struggling to install OGRE on my Debian/etch through attempts spread over a month or so already. I have to admit I've only been using Linux for round about two months now but think I've more or less come to grips with it. I managed to install all the dependencies (iirc, it's been some time). I had some Problems regarding Gtkmm2, Glademm2 and libsigc as the dev packages seem to remove each other again. But as they are only regarded as optional i figured the runtimes will have to do for now (though, if you've got a solution for that I'd like to try it). I managed to install CEGUI aswell just yesterday and even got ./bootstrap and ./configure running without errors (I had to copie some .m4 files like libtool.m4 to the /usr/share/aclocal/ dir ).

Now however when I tried to make ogrenew it aborted telling me:

Code: Select all

[...]
make[4]: Leaving directory `/home/martin/Development/ogrenew/RenderSystems/GL/src/GLSL'
make[4]: Entering directory `/home/martin/Development/ogrenew/RenderSystems/GL/src'
/bin/sh ../../../libtool --tag=CXX --mode=link g++  -g -O2   -o RenderSystem_GL.la -rpath /usr/local/lib/OGRE -module -shared -avoid-version -L../../../OgreMain/src -Wl,-z,defs OgreGLEngineDll.lo OgreGLPlugin.lo OgreGLGpuProgram.lo OgreGLGpuNvparseProgram.lo OgreGLGpuProgramManager.lo OgreGLRenderSystem.lo OgreGLSupport.lo OgreGLTexture.lo OgreGLTextureManager.lo OgreGLHardwareBufferManager.lo OgreGLHardwareIndexBuffer.lo OgreGLHardwareOcclusionQuery.lo OgreGLHardwareVertexBuffer.lo OgreGLHardwarePixelBuffer.lo OgreGLDefaultHardwareBufferManager.lo OgreGLContext.lo OgreGLPixelFormat.lo OgreGLRenderTexture.lo OgreGLFBORenderTexture.lo OgreGLPBRenderTexture.lo OgreGLFBOMultiRenderTarget.lo OgreGLFrameBufferObject.lo glew.lo ../../../RenderSystems/GL/src/GLX/libsupport.la ../../../RenderSystems/GL/src/GLSL/src/libGLSL.la ../../../RenderSystems/GL/src/nvparse/libnvparse.la ../../../RenderSystems/GL/src/atifs/src/libatifs.la -lGL -lGLU -lX11 -lXext -lGL -lXrandr -lXxf86vm -lOgreMain  -lCg -lfreeimage -lpthread -lz -lm -ldl
g++ -shared -nostdlib /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crti.o /usr/lib/gcc/i486-linux-gnu/4.1.2/crtbeginS.o  .libs/OgreGLEngineDll.o .libs/OgreGLPlugin.o .libs/OgreGLGpuProgram.o .libs/OgreGLGpuNvparseProgram.o .libs/OgreGLGpuProgramManager.o .libs/OgreGLRenderSystem.o .libs/OgreGLSupport.o .libs/OgreGLTexture.o .libs/OgreGLTextureManager.o .libs/OgreGLHardwareBufferManager.o .libs/OgreGLHardwareIndexBuffer.o .libs/OgreGLHardwareOcclusionQuery.o .libs/OgreGLHardwareVertexBuffer.o .libs/OgreGLHardwarePixelBuffer.o .libs/OgreGLDefaultHardwareBufferManager.o .libs/OgreGLContext.o .libs/OgreGLPixelFormat.o .libs/OgreGLRenderTexture.o .libs/OgreGLFBORenderTexture.o .libs/OgreGLPBRenderTexture.o .libs/OgreGLFBOMultiRenderTarget.o .libs/OgreGLFrameBufferObject.o .libs/glew.o -Wl,--whole-archive ../../../RenderSystems/GL/src/GLX/.libs/libsupport.a ../../../RenderSystems/GL/src/GLSL/src/.libs/libGLSL.a ../../../RenderSystems/GL/src/nvparse/.libs/libnvparse.a ../../../RenderSystems/GL/src/atifs/src/.libs/libatifs.a -Wl,--no-whole-archive  -Wl,--rpath -Wl,/home/martin/Development/ogrenew/OgreMain/src/.libs -Wl,--rpath -Wl,/usr/local/lib -L/home/martin/Development/ogrenew/OgreMain/src -lGLU -lX11 -lXext -lGL -lXrandr -lXxf86vm /home/martin/Development/ogrenew/OgreMain/src/.libs/libOgreMain.so -L/usr/lib -lCg -lfreeimage -lpthread -lz -ldl -L/usr/lib/gcc/i486-linux-gnu/4.1.2 -L/usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/i486-linux-gnu/4.1.2/crtendS.o /usr/lib/gcc/i486-linux-gnu/4.1.2/../../../../lib/crtn.o  -Wl,-z -Wl,defs -Wl,-soname -Wl,RenderSystem_GL.so -o .libs/RenderSystem_GL.so
/usr/bin/ld: cannot find -lGL
collect2: ld returned 1 exit status
make[4]: *** [RenderSystem_GL.la] Fehler 1
make[4]: Leaving directory `/home/martin/Development/ogrenew/RenderSystems/GL/src'
make[3]: *** [all-recursive] Fehler 1
make[3]: Leaving directory `/home/martin/Development/ogrenew/RenderSystems/GL/src'
make[2]: *** [all-recursive] Fehler 1
make[2]: Leaving directory `/home/martin/Development/ogrenew/RenderSystems/GL'
make[1]: *** [all-recursive] Fehler 1
make[1]: Leaving directory `/home/martin/Development/ogrenew/RenderSystems'
make: *** [all-recursive] Fehler 1
I was able to track down the needed file...:

Code: Select all

# find / -name libGL.*
/home/martin/ATI-Treiber/libGL.so.1
/usr/X11R6/lib/libGL.so.1
/usr/lib/libGL.so.1.2
/usr/lib/libGL.so.1
/usr/lib/fglrx/diversions/libGL.so.1.2
/usr/lib/fglrx/diversions/libGL.so.1
.. but I've neither got a clue why he can't find it nor how to tell him where to search. I would be grateful if someone tells me how to fix it. Thanks in advance.

(btw I put /usr/lib/libGL.so.1.2 there myself as it was missing when i tried to install my ATI-driver fglrx. libGL.so.1 is just a link to that file)

Posted: Sat Nov 03, 2007 5:02 pm
by Auria
I'm not sure what you mean with -dev packages removing each other, but i think you should seek answers on a debian forum/mailing list because i don't beleive it's supposed to be that hard :)

also i don't believe you should have put the GL libs there yourself, you usually should have a package in the repos that will do it (unless Debian is very different from the linux distros i've tried)

Also you probably didn't need to copy m4 files, but update your autotools or set some envrionment variable search paths (at least that's how i,ve always could solve it on my computer)

Posted: Sat Nov 03, 2007 7:47 pm
by White_Wolf
Regarding the Gtkmm2<->Glademm2 conflict, it's solved. I did search for "Gtkmm2" and "Glademm2" due to what I didn't find version 2.4 :roll:
With the new versions everything is alright with that.
I'm not sure what you mean with -dev packages removing each other, but i think you should seek answers on a debian forum/mailing list because i don't beleive it's supposed to be that hard Smile
I meant that the Gtkmm dev removed the Glademm runtimes and depended upon the Gtkmm runtimes, which the Glademm dev removed while depending on the Glademm runtimes which had been removed. Sounds crazy? it is. I installed both packages several times until that occurred to me... But IT'S SOLVED so to hell with that...


And as for copying things on my own, I only did what that article said at Confirm that it worked.

The hack of copying the m4's was suggested from someone within this forum(can't find the thread, had found it by searching for the error message which is gone by now) as a solution of a problem with libtool not being found.

So... problem still existing.

libGl.so

Posted: Sun Sep 14, 2008 7:44 pm
by Desync
try

sudo ln -s libGL.so.1 libGL.so

in /usr/lib

Posted: Sun Sep 14, 2008 7:56 pm
by Skiriki
Uh sorry, forgot to say I don't have that problem anymore because I moved to Ubuntu now and installed the precompiled debs for it.