I'm using the new Gcc version, 3.4.1 on Linux and I had
a great trouble with 0.9.7-x version of osg.
This compiler has precise requirements in code
structure.
While the Producer and the Thread Packages has been
compiled without troubles, the OSG package had
problems in linker ....
make[3]: Entering directory
`/root/OSG_OP_OT-0.9.7-3/OpenSceneGraph/src/osg/Linux32.Opt'
g++ -O2 -L/usr/X11R6/lib -L../../../lib/Linux32 -shared
AlphaFunc.o AnimationPath.o ApplicationUsage.o
ArgumentParser.o AutoTransform.o Array.o Billboard.o
BoundingBox.o BoundingSphere.o BlendColor.o
BlendFunc.o ClipNode.o ClipPlane.o ColorMask.o
ColorMatrix.o CollectOccludersVisitor.o
ConvexPlanarPolygon.o ConvexPlanarOccluder.o
CoordinateSystemNode.o CopyOp.o
ClusterCullingCallback.o CullFace.o CullingSet.o
CullStack.o CullSettings.o Depth.o DisplaySettings.o
Drawable.o DrawPixels.o ClearNode.o Fog.o
FragmentProgram.o FrameStamp.o FrontFace.o
GLExtensions.o Geometry.o Geode.o Group.o dxtctool.o
Image.o ImageStream.o Impostor.o ImpostorSprite.o
LOD.o Light.o LightModel.o LightSource.o LineSegment.o
LineStipple.o LineWidth.o Material.o Matrixf.o Matrixd.o
MatrixTransform.o Multisample.o Node.o NodeCallback.o
NodeVisitor.o Notify.o Object.o OccluderNode.o
PagedLOD.o Point.o PointSprite.o PolygonMode.o
PolygonOffset.o PolygonStipple.o
PositionAttitudeTransform.o PrimitiveSet.o Projection.o
Quat.o Referenced.o Sequence.o ShadeModel.o
ShadowVolumeOccluder.o Shape.o ShapeDrawable.o
State.o StateSet.o Stencil.o Switch.o TexEnv.o
TexEnvCombine.o TexGen.o TexGenNode.o TexMat.o
Texture.o Texture2D.o Texture1D.o Texture3D.o
TextureCubeMap.o TextureRectangle.o Timer.o
Transform.o UnitTestFramework.o Version.o Vec3.o
VertexProgram.o Viewport.o -lstdc++ -lGLU -lGL
-lOpenThreads -o libosg.so
`.L68' referenced in section `.rodata' of Image.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of Image.o
`.L69' referenced in section `.rodata' of Image.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of Image.o
`.L77' referenced in section `.rodata' of Image.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of Image.o
`.L70' referenced in section `.rodata' of Image.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of Image.o
`.L71' referenced in section `.rodata' of Image.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of Image.o
`.L53' referenced in section `.rodata' of PrimitiveSet.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of PrimitiveSet.o
`.L54' referenced in section `.rodata' of PrimitiveSet.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of PrimitiveSet.o
`.L62' referenced in section `.rodata' of PrimitiveSet.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of PrimitiveSet.o
`.L55' referenced in section `.rodata' of PrimitiveSet.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of PrimitiveSet.o
`.L56' referenced in section `.rodata' of PrimitiveSet.o:
defined in discarded section
`.gnu.linkonce.t._ZNK3osg12PrimitiveSet16getNumPrimitivesEv'
of PrimitiveSet.o
collect2: ld returned 1 exit status
make[3]: *** [libosg.so] Error 1
make[3]: Leaving directory
`/root/OSG_OP_OT-0.9.7-3/OpenSceneGraph/src/osg/Linux32.Opt'
make[2]: *** [libosg.so.opt] Error 2
make[2]: Leaving directory
`/root/OSG_OP_OT-0.9.7-3/OpenSceneGraph/src/osg'
make[1]: *** [default] Error 1
make[1]: Leaving directory
`/root/OSG_OP_OT-0.9.7-3/OpenSceneGraph/src'
make: *** [default] Error 1
I looked at the message "defined in discarded section" in
GOOGLE and I found someone else that had the same
problem for a different package and processor and
explain how to solve it , but the solution seem to be a
little forced.
http://sources.redhat.com/ml/binutils/2004-08/msg00187.html
I don't know how to solve this problem but I suppose
that it should be fixed to avoid the same problem in
future, when this class of compilers will be used in
official distributions.
Thanks, Mark - sprmark@email.it
Logged In: NO
Note *** I found a solution to this problem that I have
posted yesterday, by placing the code of the PrimitiveSet
class method :
virtual unsigned int getNumPrimitives() const;
Directly into the code of PrimitiveSet.cpp instead of as an
inline funcion.
This avoid the mistake created by the inline optimizer.
Bye.