Page 1 of 1

ogre can't compile under gcc 4.3.0?

PostPosted: Mon Jun 23, 2008 4:54 pm
by liyu
I have compiled ogre 1.4.9 on gcc 3.4.5 succ, when i upgrade gcc to 4.3.0, it give me a error:

gcc\mingw32\4.3.0\include\c++\bits\stl_vector.h|179|instantiated from 'std::vector<Ogre::LinkedSkeletonAnimationSource, std::allocator<Ogre::LinkedSkeletonAnimationSource> >'|
..\include\OgreSkeleton.h|423|instantiated from here|

gcc\mingw32\4.3.0\include\c++\bits\boost_concept_check.h|216|error: '__gnu_cxx::_SGIAssignableConcept<_Tp>::__a' has incomplete type|
..\include\OgreSkeleton.h|53|error: forward declaration of 'struct Ogre::LinkedSkeletonAnimationSource'|

it seems gcc 4.3.0 add check to this, because c++ stand not say what should to when using a incomplete class in stl vector.

after some searching on google, I know i can rebuild gcc without concept-checks to walk around this problem, however, I think the best choice is to change the ogre code, will it?

btw, I suprised I am the only one use gcc 4.3 here? :shock:

PostPosted: Tue Jun 24, 2008 12:37 pm
by sinbad
LinkedSkeletonAnimationSource is predeclared earlier and defined later in the same header file, the reason is that there's a circular issue here. If gcc really won't allow this then we may have to change the list to a list of pointers instead, but other gcc 4.x versions have been happy with it. The latest I've tested with is 4.2 though.

PostPosted: Tue Jun 24, 2008 1:01 pm
by liyu
great, I'll wait it :)

PostPosted: Thu Jun 26, 2008 2:32 pm
by th0br0
hey,
I just emerged gcc 4.3.1 here and although it is not 4.3.0, ogre appears to compile just fine with it
so it might just be a mingw32 bug.

th0br0

Re: ogre can't compile under gcc 4.3.0?

PostPosted: Thu Jun 26, 2008 5:41 pm
by Bekas
liyu wrote:I know i can rebuild gcc without concept-checks to walk around this problem, however, I think the best choice is to change the ogre code, will it?

You can disable it from an include file.
-Open "MinGW\lib\gcc\mingw32\4.3.0\include\c++\mingw32\bits\c++config.h"
-Find "#define _GLIBCXX_CONCEPT_CHECKS 1" line and comment it out.

Concept checking is disabled by default when building gcc, don't know why the mingw version has it enabled..

Re: ogre can't compile under gcc 4.3.0?

PostPosted: Fri Jun 27, 2008 2:30 pm
by liyu
Bekas wrote:You can disable it from an include file.
-Open "MinGW\lib\gcc\mingw32\4.3.0\include\c++\mingw32\bits\c++config.h"
-Find "#define _GLIBCXX_CONCEPT_CHECKS 1" line and comment it out.

Concept checking is disabled by default when building gcc, don't know why the mingw version has it enabled..


This doesn't work for me, I think rebuild gcc is need, have u tried it?

PostPosted: Fri Jun 27, 2008 2:56 pm
by Bekas
I didn't try compiling ogre, commenting out "#define _GLIBCXX_CONCEPT_CHECKS 1" worked when compiling codeblocks.