15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by d000hg »

A few warnings is something I can ignore, but over 15 thousand?! It's 100k lines of output which is enough to make VS struggle!

It's too long to put the whole thing in PasteBin but it's just masses of stuff like:
1>c:\programming\ogre3d\ogre_src_v1-8-1\ogremain\include\OgreSingleton.h(94) : warning C4661: 'Ogre::ResourceGroupManager *Ogre::Singleton<T>::msSingleton' : no suitable definition provided for explicit template instantiation request
1> with
1> [
1> T=Ogre::ResourceGroupManager
1> ]
1> c:\programming\ogre3d\ogre_src_v1-8-1\ogremain\include\OgreSingleton.h(75) : see declaration of 'Ogre::Singleton<T>::msSingleton'
1> with
1> [
1> T=Ogre::ResourceGroupManager
1> ]
And:
1>c:\programming\Ogre3D\ogre_src_v1-8-1\OgreMain\include\OgreSubMesh.h(268) : warning C4251: 'Ogre::SubMesh::mBoneAssignments' : class 'std::multimap<_Kty,_Ty,_Pr,_Alloc>' needs to have dll-interface to be used by clients of class 'Ogre::SubMesh'
1> with
1> [
1> _Kty=size_t,
1> _Ty=Ogre::VertexBoneAssignment,
1> _Pr=std::less<size_t>,
1> _Alloc=Ogre::STLAllocator<std::pair<const size_t,Ogre::VertexBoneAssignment>,Ogre::GeneralAllocPolicy>
1> ]
This many warnings on what is (probably) the most widely used compiler for Ogre has me worried something just ain't right. Maybe CMake settings I applied are conflicting or something? Or should I disable a few warnings that CMake hasn't set up for me?
Transporter
Minaton
Posts: 933
Joined: Mon Mar 05, 2012 11:37 am
Location: Germany
x 110

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by Transporter »

Switch off warning 4251. It's switched off in 1.9.0 but I don't know about 1.8.1.
Knotanalt
Halfling
Posts: 94
Joined: Sun Jul 01, 2012 2:58 pm
x 2

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by Knotanalt »

Most of the warnings compilers give you are kind of ridiculous and pointless. Ideally the ones that are ignored by ogre should be turned off by preprocessor but it is probably a lot of work at this point.
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by d000hg »

I just don't remember getting them on older versions!

I actually get some of the same warnings - or obviously similar on iOS too for 1.8. I mainly wanted to check before I suppress the warnings in case it was important!

For now I disabled warnings 4251;4661;4275... is there an easy way I could hack that into my cmake files locally so I don't lose it every time I re-configure?
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by d000hg »

I've been looking into this further... definitely something is different because my own code is now spewing these warnings, as well as "warning C4193: #pragma warning(pop) : no matching '#pragma warning(push)'" and it never used to on 1.8RC1.

It must be a bug somewhere, either in my setup or Ogre itself, if it didn't use to do this?
inzero
Kobold
Posts: 33
Joined: Sun Dec 19, 2010 9:55 am

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by inzero »

It's a problem with 1.8.1, there's a post about some incorrect stuff in a header here: http://www.ogre3d.org/forums/viewtopic.php?f=2&t=72016. It's also mentioned that the problem is fixed in 1.9.
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by d000hg »

Hmm, so what exactly IS the glitch? Something must have changed that 1.8.x started complaining. And how come no fix... I locally hacked my CMakeLists with warning suppression so should I submit a patch or do we need to fix whatever is causing the issue in the first place?

I don't feel happy using 1.9 since it's not classed as stable - I only just switched to 1.8 :)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by jacmoe »

IIRC, we talked about this a while ago and decided to push the pragma warning disable and pop it after Ogre code so that people who want to turn on all warnings can do this.
I guess something went awry with 1.8.1 ..
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by jacmoe »

Yes, right here:
http://www.ogre3d.org/forums/viewtopic. ... op#p469132

It's a bug.
I guess you'd be fine if you read that topic and un-define according to the linked to post.
It looks like we reverted back to the way it was before the pragma push/pop routine.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by d000hg »

Ah, I was wondering about all that push/pop stuff. Thanks. Is there any chance it will be fixed in 1.8 or is that a dead branch now? Or maybe it even was fixed in 1.8.2 and I'm the one on old code?
d000hg
Goblin
Posts: 257
Joined: Tue Sep 02, 2008 9:41 pm
x 1

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by d000hg »

jacmoe wrote:Yes, right here:
http://www.ogre3d.org/forums/viewtopic. ... op#p469132

It's a bug.
I guess you'd be fine if you read that topic and un-define according to the linked to post.
It looks like we reverted back to the way it was before the pragma push/pop routine.
I have tried this and it doesn't seem to fix anything. I have:

Code: Select all

#ifndef __OgreHeaderPrefix_H__
#define __OgreHeaderPrefix_H__

#include "OgrePrerequisites.h"

#if OGRE_COMPILER == OGRE_COMPILER_MSVC

// Save warnings state
#   pragma warning (push)

...

#endif


#endif
// d000hg added this based on other posts
#undef __OgreHeaderPrefix_H__

Code: Select all

#ifndef __OgreHeaderSuffix_H__
#define __OgreHeaderSuffix_H__

#include "OgrePrerequisites.h"

#if OGRE_COMPILER == OGRE_COMPILER_MSVC

// restore previous warnings settings
#   pragma warning (pop)


#endif


#endif
// allow inclusion of prefix again now (this is scoped)
#undef __OgreHeaderSuffix_H__
I save the prefix header and do a VC++ rebuild on OgreMain and start getting drowned by warnings.

But anyway there is another problem I see... I was setting the warning suppression on VC++ project properties for Ogre projects and Ogre built without all the warnings... great. Then I set the suppression on MY project and I STILL get all the warnings from Ogre headers. My guess is that my project sets the warning suppressions and perhaps Ogre comes along and calls pop() and clears them? Is that possible?

It's seeming to me that commenting out the pop/push calls is the only fix. But still I want to know - what actually changed in 1.8 because it sounds like we used prefix/suffix for many years (if Sinbad was involved it must be old!)
User avatar
nec
Gremlin
Posts: 175
Joined: Fri Sep 29, 2006 5:56 pm
Location: Rosny Sous Bois, France
x 11

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by nec »

take a look at this thread
eternallite
Gnoblar
Posts: 2
Joined: Wed Apr 17, 2013 3:53 am
x 1

Re: 15 THOUSAND warnings compiling OgreMain 1.8.1 on VS2008

Post by eternallite »

I disabled the warnings as a workaround for Ogre 1.81 (in Visual Studio):

Project properties > Configuration Properties > C/C++ > Advanced > Disable Specific Warnings

and entered: 4275;4251;4193

(since I didn't care for those warnings)

Make sure to select "All Configurations" so it is disabled for both Debug and Release versions.

Edit: Didn't read the post properly; oh well, instructions are here in case anyone needs it :)