bug in visual studio makefile

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

bug in visual studio makefile

Post by Nickak2003 »

In ogre src, there is a reference to __cplusplus define. This macro is bugged on visual studio and always says, 199711L. therefore, when higher c++ version is used, the code generated ends up being error-causing. To fix this error, the makefile must add to the CXX FLAGS the following:

/Zc:__cplusplus

This causes it to return the proper value on recent visual studios/c++.

you can read more here:
https://devblogs.microsoft.com/cppblog/ ... cplusplus/

Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

Re: bug in visual studio makefile

Post by Nickak2003 »

That said, is there planned migration to higher c++?

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: bug in visual studio makefile

Post by dark_sylinc »

Hi!

I don't remember hitting this. What version of Visual Studio are you using?

Nickak2003 wrote: Sat Jun 04, 2022 6:11 pm

That said, is there planned migration to higher c++?

OgreNext 3.0 will require C++11

Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

Re: bug in visual studio makefile

Post by Nickak2003 »

The most brand spanking new Visual studio, set to extreme c++. Your old adapter code is depreciated.
Well, I think we may all have been using the adapter code rather than modern code, because of this bug. And anyways, it no longer compiles.
Anyway, this CXX Flag results in compilation.

User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5296
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1278
Contact:

Re: bug in visual studio makefile

Post by dark_sylinc »

Can you post the error from the error from the compiler log?
And Visual Studio version.

Thanks.

Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

Re: bug in visual studio makefile

Post by Nickak2003 »

c++11? You realize that the new visual studio has a C++ 2020 setting? Are you aware of newer C++ concepts that could be applicable to your project or not, and what are they?

Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

Re: bug in visual studio makefile

Post by Nickak2003 »

Ok, to generate the error, ALl i should have to do is undo makefile change and regenerate, will do real quick

Nickak2003
Goblin
Posts: 272
Joined: Thu Jun 10, 2004 4:19 am
x 26

Re: bug in visual studio makefile

Post by Nickak2003 »

OgreMemorySTLAllocator.h

line #125 reference of __cplusplus

erroneously has been returning, 199711L !! VISUAL STUDIO GODS WTF IS THAT

go ahead and look at the value, see for yourself

Post Reply