升级XCode 5.0后,C ++代码无法编译-> 5.1“类的前向声明不能具有嵌套的名称说明符". [英] C++ code fails to compile after upgrading XCode 5.0 -> 5.1 "forward declaration of class cannot have a nested name specifier"

查看:123
本文介绍了升级XCode 5.0后,C ++代码无法编译-> 5.1“类的前向声明不能具有嵌套的名称说明符".的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.h文件中有此文件

I have this in a .h file:

class Ogre::ManualObject;

我不知道它是怎么到达那里的,但是它总是在多个编译器下进行编译-直到XCode5.1突然将其作为错误引发.

I don't know how it got there but it's always compiled under multiple compilers - until suddenly XCode5.1 raises it as an error.

Apple是否再次更改了C ++编译器?

Have Apple changed the C++ compiler again?

推荐答案

按照约翰的建议,将class Ogre::ManualObject;更改为namespace Ogre{ class ManualObject;}.我遇到了完全相同的问题(但声明不同),也遇到了Ogre和Xcode 5.1.更改了3行,一切正常.

As John suggested, change class Ogre::ManualObject; to namespace Ogre{ class ManualObject;}. I had exactly the same problem (but with different declarations), also with Ogre and Xcode 5.1. Changed 3 lines, everything worked.

这篇关于升级XCode 5.0后,C ++代码无法编译-> 5.1“类的前向声明不能具有嵌套的名称说明符".的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆