Ogre xcode build error: Reference to 'FileInfo' is ambiguous

6 篇文章 0 订阅
1 篇文章 0 订阅

When update Ogre source to the stable version 1.9 with Mac osx 10.7,Xcode 4.6.3, CMake 2.8.10.2, I get  this error

 

Reference to 'FileInfo' is ambiguous

 

 

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Frameworks/CarbonCore.framework/Headers/Finder.h:236:8: Candidate found by name lookup is 'FileInfo'

 

Ogre-1.9-mercurial/OgreMain/include/OgreArchive.h:53:12: Candidate found by name lookup is 'Ogre::FileInfo'

 

 

 

 

 

it is about include the Ogre.h or OgreWindowEentUtilities.h in the source code, but it is strange because it had never occured before.

I had googled and tried a lot, but all failed to solve it.

but finally, I got it.

remove any defination of  using namespace Ogre;   in any header file that is not limited its scope.

I had added the this line of code in a header file, and the defination is not limited in that class, then I include it in some other header files, then included those header files in some more header files ..

so at the end, I had included a header has a defination of using namespace Ogre;  and then I include a Ogre.h

the Ogre.h include OgreWindowEventUtilities.h, the OgreWindowEventUtilities.h, then include a Carbon.h, and include to the FInder.h,  in this header file, there is a defination struct FileInfo, while the Ogre name space has a defination FileInfo too,. And there is a defination using namespace Ogre;   ,so these two defination are coflicted.

 

experience I get from this class.

 

1. whenever use this command: using namespace, limits its active scope 

2. Don't jump to on googling and googling  before think deeply first.

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值