Well I spent three days looking for some stupid bugs and I think I might just give some suggestions to the users that are going to compile ogre on linux.
- Clean all ogre stuff from the installation, otherwise, it will fail, remove all files and do make uninstall on old installations
- Check your automake/autoconf/libtool/pkg-config versions, they should be the latest possible
- Make sure your libdevil is not something higher than 1.6.5(as described in docs), debian version of the library is 1.6.8(or 1.6.7), dont use it, it failed for me and might fail for you too.
- Install latest libmesa drivers and headers and make sure they are working(compile a gl application to test)
- If ogre compiled fine but cant link(relink problems), use ./configure CC=g++ after a make clean(make distclean works too)
- Test if your glxgears works and glxinfo too before complaining
- If your app with Gui(using cegui) is crashing at the start, try to convert the images from .tga to .png, happened to me once and this fixed
- If your cegui cant display images correctly, make sure you are using power of 2 images(128x128,256x256,512x512)..
- If you are experiencing problems using debian unstable and gcc4, just do that on configure ./configure CC=g++ CXX=g++ , that will solve the undefined reference and link