C++11

Everything about development and the OpenMW source code.
Post Reply
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: C++11

Post by corristo »

Situation is pretty bad =\

Ogre compiles against libc++, no problem, but fails greatly when added -std=c++11 switch (clang doesn't support incomplete types as a template argument, as of standard, but other compilers ignores this). So, currently I can't use ANY c++11 features with Clang & Ogre.

More information: http://clang.llvm.org/compatibility.htm ... incomplete

Last chance is to try gcc and build everything with it, and distribute it's libstdc++ binary with OpenMW.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: C++11

Post by Zini »

Any progress? We need to come to a conclusion rather sooner than later, because we can not have a release before this issue has been resolved; one way or the other.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: C++11

Post by corristo »

Looks like it's currently impossible to build Ogre with gcc on OS X, since it uses Cocoa (mac UI framework) headers, and this headers defines blocks, but gcc's Objective-C front-end knows nothing about blocks.

So, no C++11 for OpenMW so far :(
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: C++11

Post by Zini »

Okay then. I reverted the wiki and added an issue to the tracker for making the necessary adjustments. Please keep an eye on the situation and inform us if something changes.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: C++11

Post by corristo »

Of course, I'll let you know if something changes. Ogre's incompatibility with Clang's c++11 mode is currently a main issue.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: C++11

Post by corristo »

Here's one:

Code: Select all

/Users/corristo/Projects/OpenMW/openmw/components/bsa/bsa_archive.cpp:94:49: error: 
      no member named 'move' in namespace 'std'
            mIndex.insert (std::make_pair (std::move ...
                                           ~~~~~^
Chris
Posts: 1626
Joined: 04 Sep 2011, 08:33

Re: C++11

Post by Chris »

Just tried to merge master and building broke:
cc1plus: error: unrecognized command line option "-std=c++03"
And indeed, looking at man gcc it doesn't list c++03 as a valid option for -std. There's c++98, gnu++98, c++0x, and gnu++0x. I'm using GCC 4.5.
User avatar
Zini
Posts: 5538
Joined: 06 Aug 2011, 15:16

Re: C++11

Post by Zini »

Odd. GCC 4.6 accepts c++03 without complaining. Anyway, fixed now.
corristo
Posts: 495
Joined: 12 Aug 2011, 08:29

Re: C++11

Post by corristo »

Status update: I took a closer look at the Ogre 1.9.0 sources and it seems that they actually did fix c++11 compilation issues on Mac.

On the other side 1.9.0 completely screwed my build workflow and I can't test it immediately. Maybe closer to 1.9.0 final release.
User avatar
MaddTheSane
Posts: 4
Joined: 13 Sep 2013, 17:29
Location: Utah

Re: C++11

Post by MaddTheSane »

corristo wrote:Looks like it's currently impossible to build Ogre with gcc on OS X, since it uses Cocoa (mac UI framework) headers, and this headers defines blocks, but gcc's Objective-C front-end knows nothing about blocks.

So, no C++11 for OpenMW so far :(
OS X's GCC distributed with Xcode should implement blocks if the OS X target is 10.6 or later. At least, the GCC compiler distributed by Xcode 4. Earlier Xcode versions may need GCC 4.2 or LLVM GCC 4.2.

I can see a non-Apple (or non-patched) version of GCC having issues with blocks.

Also, is it completely impossible to mix different libraries that depend on libstdc++ and libc++?

Libc++ is also only available on Lion (10.7) or later.
Post Reply