Note that there are some explanatory texts on larger screens.

plurals
  1. PO/usr/lib appears not to be a default link location
    primarykey
    data
    text
    <p>EDIT:<br> After a bit more digging I have found that I have a libGL.so at <code>/usr/lib/i386-linux-gnu/libGL.so</code> and if I move this away then linking works correctly again. After looking at the error line for a while I thought that the full path to libGL.so in the message was suspicious because it would have been looking at multiple locations to find it and usually it only shows the name of the library not one specific full path. So the question now is; why did finding the other version cause the search to stop and show a confusing error message? (I'm the i386ness made it incompatible in some way).</p> <p>ORIG:<br> For some reason I am having trouble linking in libGL.so into my application. The issue seems to be that ld (or gold in this case) is not looking in /usr/lib (which from everything I can find is one of the default locations) when trying to find it instead it is looking in a bit of a whacky location e.g.</p> <blockquote> <p>/usr/bin/ld: error: cannot open /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libGL.so: No such file or directory</p> </blockquote> <p>Now /usr/lib/libGL.so definitely exists and I if I do an explicit -L/usr/lib in the makefile everything links correctly. </p> <p>I'm wondering does anyone know what is going on here?</p> <p>Info:<br> Ubuntu linux 12.10 x86<br> g++ 4.7<br> GNU gold linker<br> CPU AMD Phenom 2 x6<br> uname -m out: i686 </p> <p>EDIT: Output of link with -v parameter:</p> <pre><code>Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper Target: i686-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.2-2ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu Thread model: posix gcc version 4.7.2 (Ubuntu/Linaro 4.7.2-2ubuntu1) COMPILER_PATH=/usr/lib/gcc/i686-linux-gnu/4.7/:/usr/lib/gcc/i686-linux-gnu/4.7/:/usr/lib/gcc/i686-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.7/:/usr/lib/gcc/i686-linux-gnu/ LIBRARY_PATH=/usr/lib/gcc/i686-linux-gnu/4.7/:/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/:/usr/lib/gcc/i686-linux-gnu/4.7/../../../../lib/:/lib/i386-linux-gnu/:/lib/../lib/:/usr/lib/i386-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/i686-linux-gnu/4.7/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-o' 'application' '-v' '-L/home/user/src/tutorials/application/builds/./vendor/ogre3d/./lib' '-shared-libgcc' '-mtune=generic' '-march=i686' /usr/lib/gcc/i686-linux-gnu/4.7/collect2 --sysroot=/ --build-id --no-add-needed --as-needed --eh-frame-hdr -m elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 -z relro -o application /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crt1.o /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crti.o /usr/lib/gcc/i686-linux-gnu/4.7/crtbegin.o -L/home/user/src/tutorials/application/builds/./vendor/ogre3d/./lib -L/usr/lib/gcc/i686-linux-gnu/4.7 -L/usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu -L/usr/lib/gcc/i686-linux-gnu/4.7/../../../../lib -L/lib/i386-linux-gnu -L/lib/../lib -L/usr/lib/i386-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/i686-linux-gnu/4.7/../../.. /home/user/src/tutorials/application/builds/./src/most_basic_main.o /home/user/src/tutorials/application/builds/./src/QOgreWidget.o /home/user/src/tutorials/application/builds/./src/QtOgreApplication.o /home/user/src/tutorials/application/builds/./src/qt_gen/QtOgreApplication.moc.o /home/user/src/tutorials/application/builds/./src/qt_gen/QOgreWidget.moc.o -lpthread -lQtCore -lQtNetwork -lQtGui -lQtOpenGL -lRenderSystem_GLStatic -lOgreMainStatic -ldl -lfreetype -lXrandr -lGL -lGLU -lxcb -lX11 -lXext -lXpm -lXaw7 -lXt -lzzip -lfreeimage -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /usr/lib/gcc/i686-linux-gnu/4.7/crtend.o /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/crtn.o /usr/bin/ld: error: cannot open /usr/lib/gcc/i686-linux-gnu/4.7/../../../i386-linux-gnu/libGL.so: No such file or directory </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload