views:

185

answers:

1

I'm trying to build an iPhone app using the OGRE framework, and I'm getting a linker error when building for the simulator that I'm not sure how to fix.

I created the Xcode project using the OGRE iPhone template. I'm using the static libraries for OGRE from the main website, Ogre_iOS_4.0_Dependencies_20100623, and trying to build for the iOS 4.1 Simulator. I'm building with Xcode 3.2.4 on Mac OS X 10.6.4.

Compilation seems to work fine, but when it gets to the link stage, I get the following errors:

Ld build/Debug-iphonesimulator/OgreTestApp.app/OgreTestApp normal i386
cd /Users/pauly/Projects/workspaces/games/OgreTestApp
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk -L/Users/pauly/Projects/workspaces/games/OgreTestApp/build/Debug-iphonesimulator -L/Users/pauly/Projects/sdk/Ogre/OgreSDK-iPhone/lib/release -L/Users/pauly/Projects/sdk/Ogre/OgreSDK-iPhone/iPhoneDependencies/lib/release -F/Users/pauly/Projects/workspaces/games/OgreTestApp/build/Debug-iphonesimulator -filelist /Users/pauly/Projects/workspaces/games/OgreTestApp/build/OgreTestApp.build/Debug-iphonesimulator/OgreTestApp.build/Objects-normal/i386/OgreTestApp.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework OpenGLES -framework QuartzCore -lboost_date_time -lboost_thread -lFreeImage -lFreeType -lOIS -lzzip -lOgreMainStatic -lRenderSystem_GLESStatic -lPlugin_BSPSceneManagerStatic -lPlugin_OctreeSceneManagerStatic -lPlugin_ParticleFXStatic -o /Users/pauly/Projects/workspaces/games/OgreTestApp/build/Debug-iphonesimulator/OgreTestApp.app/OgreTestApp

ld: warning: __gnu_cxx::new_allocator<std::_Rb_tree_node<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::allocate(unsigned long, void const*)has different visibility (default) in /Users/pauly/Projects/sdk/Ogre/OgreSDK-iPhone/lib/release/libOIS.a(OISInputManager.o) and (hidden) in /Users/pauly/Projects/workspaces/games/OgreTestApp/build/OgreTestApp.build/Debug-iphonesimulator/OgreTestApp.build/Objects-normal/i386/OgreFramework.o
ld: warning: std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >::_M_create_node(std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::basic_string<char, std::char_traits<char>, std::allocator<char> > > const&)has different visibility (default) in /Users/pauly/Projects/sdk/Ogre/OgreSDK-iPhone/lib/release/libOIS.a(OISInputManager.o) and (hidden) in /Users/pauly/Projects/workspaces/games/OgreTestApp/build/OgreTestApp.build/Debug-iphonesimulator/OgreTestApp.build/Objects-normal/i386/OgreFramework.o
ld: warning: std::char_traits<char>::eq(char const&, char const&)has different visibility (hidden) in /Users/pauly/Projects/sdk/Ogre/OgreSDK-iPhone/lib/release/libFreeImage.a(IPTC.o) and (default) in /Users/pauly/Projects/sdk/Ogre/OgreSDK-iPhone/lib/release/libOgreMainStatic.a(OgreString.o)
ld: warning: std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_insert_aux(__gnu_cxx::__normal_iterator<std::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)has different visibility (hidden) in /Users/pauly/Projects/sdk/Ogre/OgreSDK-iPhone/lib/release/libFreeImage.a(IPTC.o) and (default) in /Users/pauly/Projects/sdk/Ogre/OgreSDK-iPhone/lib/release/libOgreMainStatic.a(OgreScriptCompiler.o)
Undefined symbols:
  ".objc_class_name_NSAutoreleasePool", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSAutoreleasePool in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
  ".objc_class_name_UIApplication", referenced from:
      literal-pointer@__OBJC@__cls_refs@UIApplication in libOIS.a(iPhoneInputManager.o)
  ".objc_class_name_UIWindow", referenced from:
      literal-pointer@__OBJC@__cls_refs@UIWindow in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
  ".objc_class_name_UIView", referenced from:
      .objc_class_name_InputDelegate in libOIS.a(iPhoneInputManager.o)
      .objc_class_name_EAGLView in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
  ".objc_class_name_UIAccelerometer", referenced from:
      literal-pointer@__OBJC@__cls_refs@UIAccelerometer in libOIS.a(iPhoneInputManager.o)
      literal-pointer@__OBJC@__cls_refs@UIAccelerometer in libOIS.a(iPhoneAccelerometer.o)
  ".objc_class_name_CAEAGLLayer", referenced from:
      literal-pointer@__OBJC@__cls_refs@CAEAGLLayer in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
  ".objc_class_name_EAGLContext", referenced from:
      literal-pointer@__OBJC@__cls_refs@EAGLContext in libRenderSystem_GLESStatic.a(OgreEAGLESContext.o)
  ".objc_class_name_NSDictionary", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSDictionary in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
  ".objc_class_name_NSNumber", referenced from:
      literal-pointer@__OBJC@__cls_refs@NSNumber in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
  ".objc_class_name_UIScreen", referenced from:
      literal-pointer@__OBJC@__cls_refs@UIScreen in libOIS.a(iPhoneInputManager.o)
      literal-pointer@__OBJC@__cls_refs@UIScreen in libRenderSystem_GLESStatic.a(OgreEAGLSupport.o)
      literal-pointer@__OBJC@__cls_refs@UIScreen in libRenderSystem_GLESStatic.a(OgreEAGLWindow.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

How do I fix this? Thanks.

A: 

I'm having the same problem. Did you find a solution?`

Mathew Benson
Apparently the libraries were compiled against an older iOS SDK. I had to recompile from scratch, and then everything worked.
Critical Failure