Unable to build Ogre

Problems building or running the engine, queries about how to use features etc.
Post Reply
le_shatai
Gnoblar
Posts: 4
Joined: Wed Jul 11, 2007 9:12 am

Unable to build Ogre

Post by le_shatai »

Hi

I am unable to compile ogre.
I have downloaded the CVS version 1.4-3, as it was not possible to download
a src package from sourceforge. Seems to be broken.

Anyway, when compiling ogre, I get this error:

Code: Select all

g++ -shared -nostdlib /usr/lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../../../lib/crti.o /usr/lib/gcc/x86_64-unknown-linux-gnu/4.2.1/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/eclipse-workspace/ogre-1.4.3/build/OgreMain/src/.libs -Wl,--rpath -Wl,/opt/ogre/lib -L/home/martin/eclipse-workspace/ogre-1.4.3/build/OgreMain/src -lGLU -lX11 -lXext -lGL -lXrandr -lXxf86vm /home/martin/eclipse-workspace/ogre-1.4.3/build/OgreMain/src/.libs/libOgreMain.so -lfreeimage -lpthread -lz -ldl -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.2.1 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-unknown-linux-gnu/4.2.1/crtendS.o /usr/lib/gcc/x86_64-unknown-linux-gnu/4.2.1/../../../../lib/crtn.o  -Wl,-z -Wl,defs -Wl,-soname -Wl,RenderSystem_GL.so -o .libs/RenderSystem_GL.so
/usr/bin/ld: ../../../RenderSystems/GL/src/atifs/src/.libs/libatifs.a(Compiler2Pass.o): relocation R_X86_64_PC32 against `vtable for Compiler2Pass' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: final link failed: Bad value
collect2: ld returned 1 exit status
make[4]: *** [RenderSystem_GL.la] Fehler 1
So what is the problem?
I try to compile it on this system:

Code: Select all

Intel Core2Duo E6400
Nvidia GF-7600GT
ArchLinux - 64Bit
gcc-4.2
with this configuration:

Code: Select all

../configure --prefix=/opt/ogre --disable-cg --with-platform=GLX
So what's wrong, and how do I get it compiled?

Tnx
le_shatai
Gnoblar
Posts: 4
Joined: Wed Jul 11, 2007 9:12 am

Post by le_shatai »

Does noone has any idea, what can I make to get it compiled? maybe someone
from the ogre development team, or is a 64Bit-compile not possible; but the
error does not look that way.

CU
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Search please: http://www.ogre3d.org/phpBB2/viewtopic. ... light=fpic

I avoid 64-bit personally (don't need it, and too many driver hassles), but Ogre has been built on 64-bit machines. But it looks like there might be an issue with gcc 4.2 and amd64.
tyoc
Halfling
Posts: 74
Joined: Mon Apr 30, 2007 8:10 pm
Location: México, D.F.
Contact:

Post by tyoc »

Time ago I have an amd64 and builded it there, I barely remember having 1 time such a problem, but in fact dont remember how I solve it, thought what I find in a search I put it here:

http://www.ogre3d.org/phpBB2/viewtopic. ... 073#234073

Perhaps the references there can help you out.
le_shatai
Gnoblar
Posts: 4
Joined: Wed Jul 11, 2007 9:12 am

Post by le_shatai »

Thanks for the hints. I will see if I can find a work around to fix this.
If I can solve this problem, I will post the solution.

CU
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

I am on Ubuntu 64 bit - no problems here. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
le_shatai
Gnoblar
Posts: 4
Joined: Wed Jul 11, 2007 9:12 am

Post by le_shatai »

Hi

Ok, I got it compiled:
These are my settings:

Code: Select all

./configure --prefix=/opt/ogre --disable-static --enable-shared --with-platform=GLX --disable-cg --with-pic --disable-ogre-demos
This are my C[XX]FLAGS:

Code: Select all

CXXFLAGS=-fpic -fvisibility=default 
CFLAGS=-fpic -fvisibility=default 
Pay attention that I did -fpic not -fPIC.
The -fvisibility flag is for GLX compile, as there was this error :

Code: Select all

 relocation R_X86_64_PC32 against 'stat'... 
I had no time to check whether the build is working or not, but we will see.

CU
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Thanks for the tips, I was experiencing the same issue here. I'll see if I grasp enough of this auto* to make it do it by default on 64 bit systems.

It's strange as it only happens with these atifs things, the rest of Ogre compiles fine. I don't think there there will be any 64 bit systems with an ancient ATI card around, so it could just as well be disabled by default on such systems :)

Yep confirmed. If you comment out and remove the atifs from the build it builds fine. I have no idea why, because nvparse and glsupport are handled in exactly the same way in the build, and they work fine without adding any spooky build flags.
Redwolf
Kobold
Posts: 35
Joined: Sun Feb 24, 2008 12:12 am

Post by Redwolf »

[crossposted]

You can also install a gcc-3.x variant and then set these before running configure:

export CC=gcc-3.4
export CXX=g++-3.4

I just got svn to compile with 3.4 after I failed with 4.x.
Post Reply