Linux Compilation Errors


10-05-2008 20:53:24


Sorry if this has happened to others before, I couldn't find anything like it.

I'm attempting to compile 1.05 (the latest), using cmake, but all I get after running make (successful cmake run) is:

In file included from /home/tanner/Desktop/PagedGeometry/source/GrassLoader.cpp:11:
/home/tanner/Desktop/PagedGeometry/source/../include/GrassLoader.h:184: error: extra qualification ‘Forests::GrassLoader::’ on member ‘generateGrass_QUAD’
/home/tanner/Desktop/PagedGeometry/source/../include/GrassLoader.h:185: error: extra qualification ‘Forests::GrassLoader::’ on member ‘generateGrass_CROSSQUADS’
/home/tanner/Desktop/PagedGeometry/source/../include/GrassLoader.h:186: error: extra qualification ‘Forests::GrassLoader::’ on member ‘generateGrass_SPRITE’
make[2]: *** [source/CMakeFiles/PagedGeometry.dir/GrassLoader.o] Error 1
make[1]: *** [source/CMakeFiles/PagedGeometry.dir/all] Error 2
make: *** [all] Error 2

What am I missing here?



11-05-2008 22:29:11

namespace forest

solved it for me


12-05-2008 02:27:05

namespace Forests {

class GrassLayer;...

In 'GrassLoader.h'.

FlyingIsFun1217 :/


20-05-2008 19:23:50

I'm getting the same error. As far as I know, it's a new check added to GCC 4.1 and above. Basically it' complaining because the class is doing something like the following (edited for berevity):

class GrassLoader
void GrassLoader::function();

class GrassLoader
void function();

would work just as well. This would also be the much more standard way of doing it. In fact, I've never come across people qualifying function names within classes like that before.

It's really quite a simple fix, just change Ogre::Mesh *GrassLoader::generateGrass_QUAD(PageInfo &page, GrassLayer *layer, float *grassPositions, unsigned int grassCount); to Ogre::Mesh *generateGrass_QUAD(PageInfo &page, GrassLayer *layer, float *grassPositions, unsigned int grassCount); (and the other two similar functions) and it will compile just fine.


22-05-2008 15:53:25

Thanks for pointing this out. I'm not sure how that got in there, but it's probably from a copy and paste error. Still, it's strange that GCC is giving an error when this seems like a warning level problem.


22-05-2008 15:56:34

I agree it probably should really be only warning level but I can imagine cases where doing something like this could cause ambiguity. Recently gcc have been getting stricter on things like this. If they were too relaxed then it wouldn't make porting things to Linux any fun any more :).


26-05-2008 02:26:44

Sorry for not noticing this earlier. Guess I'll have to set up my build environment for it again (switched computers).

Thanks for pointing that out; that is sort of a funny way of going about things.