欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

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

程序员文章站 2022-07-12 09:18:48
...

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.