Page 1 of 1

GCC Compile error with v1-8 [SOLVED]

Posted: Mon Dec 19, 2011 2:58 am
by merlinblack
After updating my copy of ogre I found there is a compile error in OgreImage.cpp which is easily fixed by adding

Code: Select all

#include <OgreMath.h>
What struck me as odd, was that it looks like it might have been like that for a little while. :shock: Is it working for everyone else without the include?

This seems to only affect v1-8. I'm using GNU gcc 4.6.1 on Ubuntu Linux.

Here are the errors:

Code: Select all

/home/nigel/prog/ogre/OgreMain/src/OgreImage.cpp: In static member function ‘static void Ogre::Image::applyGamma(Ogre::uchar*, Ogre::Real, size_t, Ogre::uchar)’:
/home/nigel/prog/ogre/OgreMain/src/OgreImage.cpp:557:13: error: incomplete type ‘Ogre::Math’ used in nested name specifier
/home/nigel/prog/ogre/OgreMain/src/OgreImage.cpp:558:13: error: incomplete type ‘Ogre::Math’ used in nested name specifier
/home/nigel/prog/ogre/OgreMain/src/OgreImage.cpp:559:13: error: incomplete type ‘Ogre::Math’ used in nested name specifier
I would send a patch - however I don't have access to a scanner or fax to do the contributor form at the moment.

Merry Christmas if you celebrate it!

Re: GCC Compile error with v1-8

Posted: Mon Dec 19, 2011 11:24 am
by Shockeye
I had the same problem, compiling on Ubuntu. But no problems on Windows (VC2008) :?
I wonder if there is a gcc compiler flag that would make a difference?
(I've only just start experimenting with Linux, so I haven't a clue...) :)

Re: GCC Compile error with v1-8 [SOLVED]

Posted: Mon Dec 19, 2011 9:34 pm
by merlinblack
My hunch is that there isn't a flag you can tweak, since this is an error rather than a warning. I wonder if it is GCC in general or just this version. I'll try it on OSX10.6 and see what happens.

I must have only narrowly missed your post while searching! :?

EDIT: According to my twitter feed, David has patched it. Thanks!

Re: GCC Compile error with v1-8 [SOLVED]

Posted: Sun Jan 17, 2016 10:48 pm
by JDongian
I'm quite sure this isn't fixed yet, as when I was building 1.8 recently on Arch Linux, I ran into this issue and needed to add the #include manually myself.