title: iOS static library does not link XCODE 5 iOS 7
body: <p>I´m using XCode 5.0.1 on OSX 10.9 and I ´m linking libc++ (LLVM C++ standart library) and Valid architectures armv7; armv7s and both.</p>
  
  <p>1º I have created a project that use OpenCV2.framework + foo using Cmake, create a XCode project using foo.a . My executable link OpenCV2.framework + foo.a and work perfectly, compile and link.</p>
  
  <p>2º I have used Ogre´s template to create another project. This project work perfectly.</p>
  
  <p>3º Then, I try to add foo.a to the new project, to make the same things that my executable used in step 1.</p>
  
  <ul>
  <li>Adding includes path to Header Search Paths.</li>
  <li>Adding library path to Library Search Paths.</li>
  <li>Adding <strong>-ObjC -all_load</strong> -lfoo to Other Linker Paths as <a href="https://stackoverflow.com/questions/14713557/ios-static-library-xcode-linking-errors">This</a> and <a href="https://stackoverflow.com/questions/822404/how-to-set-up-cmake-to-build-an-app-for-the-iphone/972579#972579">this</a></li>
  <li>Adding code source needed in the project.</li>
  <li>When I´m using calls to foo functions --> Linking problem: Undefined symbols for architecture armv7 to foo::functionname().</li>
  </ul>
  
  <hr>
  
  <ul>
  <li>INFO:</li>
  <li>That call is exactly like the first project, that work.</li>
  <li>Using otool -hv foo.a --> I see the cputype is ARV V7 to all lib.o</li>
  <li>Using lipo -info foo.a --> I see foo.a is armv7 or armv7s when i use that arch.</li>
  <li>Using nm foo.a | grep functionname --> I see the function is inside the library in armv7 and armv7s when compile both arch.</li>
  </ul>
  
  <p>So, if the library work in another project, and the functions are inside, why the linking problem?</p>
  
  <hr>
  
  <ul>
  <li>INFO 2:</li>
  <li>Adding the foo target to the ogre´s project, same problem. Following <a href="http://www.raywenderlich.com/41377/creating-a-status-library-in-ios-tutorial" rel="nofollow noreferrer">THIS</a> method.</li>
  <li>Adding target dependencies doesnt work neither.</li>
  </ul>
  
  <hr>
  
  <p>My CmakeList to compile this sample is:</p>
  
  <pre><code> # /////////////////////////////////////////////////////////
   # //SAMPLE 
   # /////////////////////////////////////////////////////////
  
   # 3rdParty (OGRE LOCATION)
  set(OGRE_SDK_ROOT /Users/vgoni/Librerias/ogre1.9-pre/OgreSDK/ CACHE PATH "Ogre SDK ROOT")
  set(OGRE_DEPENDENCIES_DIR ${OGRE_SDK_ROOT}/iOSDependencies CACHE PATH "Ogre SDK DEP")
  
   # Set up project
  SET(PROJ_NAME ogreIOS)
  
  PROJECT( ${PROJ_NAME} )
  SET(PRODUCT_NAME ${PROJ_NAME})
  SET(EXECUTABLE_NAME ${PROJ_NAME}Executable)
  
   # Add variable to generate iphone project in ADD_EXECUTABLE
  SET(APP_TYPE MACOSX_BUNDLE)
  
   # Headers
  SET(${PROJ_NAME}_HEADERS
      include/OgreStaticPluginLoader.h
      include/OgreDemoApp.h
      include/OgreFramework.h
      include/AppDelegate.h
      )
  
   # Source
  SET(${PROJ_NAME}_SRC
      src/OgreFramework.cpp
      src/OgreDemoApp.cpp
      src/main.mm
  )
  
   # Add there files to Resources package into XCODE
  SET_SOURCE_FILES_PROPERTIES(
      resources/ogre.cfg
      resources/plugins.cfg
      resources/resources.cfg
      resources/ogreiosSample-Info.plist
      resources/ogreiosSample-Prefix.pch
      resources/en.lproj/InfoPlist.strings
      PROPERTIES
      MACOSX_PACKAGE_LOCATION Resources
  )
   # Include self directories
  INCLUDE_DIRECTORIES( include )
  
   # Include OGRE headers needed
  INCLUDE_DIRECTORIES( ${OGRE_SDK_ROOT}/include )
  INCLUDE_DIRECTORIES( ${OGRE_SDK_ROOT}/include/OIS )
  INCLUDE_DIRECTORIES( ${OGRE_SDK_ROOT}/include/OGRE )
  INCLUDE_DIRECTORIES( ${OGRE_SDK_ROOT}/include/OGRE/Overlay )
  INCLUDE_DIRECTORIES( ${OGRE_SDK_ROOT}/include/OGRE/iOS )
  INCLUDE_DIRECTORIES( ${OGRE_SDK_ROOT}/include/OGRE/RTShaderSystem )
  INCLUDE_DIRECTORIES( ${OGRE_SDK_ROOT}/include/OGRE/RenderSystems/GLES2 )
  INCLUDE_DIRECTORIES( ${OGRE_SDK_ROOT}/iOSDependencies/include )
  
   # Link Directories where libraries needed are
  LINK_DIRECTORIES( ${OGRE_SDK_ROOT}/lib/Release )
  LINK_DIRECTORIES( ${OGRE_SDK_ROOT}/iOSDependencies/lib )
  LINK_DIRECTORIES( ${OGRE_SDK_ROOT}/iOSDependencies/lib/Release )
  
   # Add ogre &amp; boots libraries flags
  SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -lmesaglsl2 -lboost_system -lboost_chrono -lboost_date_time -lboost_thread -lFreeType -lFreeImage -lzzip -lz -lc++ -lforce_load -lfoo")
   # foo is my library, force to load all to avoid fail in linking
  
   # 3rdParty ogre libraries
  SET(OGRE_LIBS OIS OgreMainStatic RenderSystem_GLES2Static OgreRTShaderSystemStatic ) 
  
   # Link the libraries needed
   #TARGET_LINK_LIBRARIES (${PROJ_NAME} ${OGRE_LIBS})
  
   # Create executable for iOS
  ADD_EXECUTABLE(
      ${EXECUTABLE_NAME}
          ${APP_TYPE}
          ${${PROJ_NAME}_HEADERS}
          ${${PROJ_NAME}_SRC}
  )
  
   # Adding info to XCode project
   #set_target_properties(${EXECUTABLE_NAME}  PROPERTIES 
      #MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/resources/Info.plist)
  
   # Change name to make work Macros
  SET(PROJ_NAME ogreIOSExecutable) 
  
   # Macro to add frameworks to Sample Executable
  link_ios_framework(AssetsLibrary    ${EXECUTABLE_NAME})
  link_ios_framework(AVFoundation     ${EXECUTABLE_NAME})
  link_ios_framework(CoreMedia        ${EXECUTABLE_NAME})
  link_ios_framework(CoreGraphics     ${EXECUTABLE_NAME})
  link_ios_framework(CoreVideo        ${EXECUTABLE_NAME})
  link_ios_framework(ImageIO          ${EXECUTABLE_NAME})
  link_ios_framework(Foundation       ${EXECUTABLE_NAME})
  link_ios_framework(OpenGLES         ${EXECUTABLE_NAME})
  link_ios_framework(QuartzCore       ${EXECUTABLE_NAME})
  link_ios_framework(UIKit            ${EXECUTABLE_NAME})
  
   # Needed dependencies
  link_ios_sdk(libc++.1.dylib ${EXECUTABLE_NAME})
  link_ios_sdk(libz.dylib ${EXECUTABLE_NAME})
  
   #Add OpenCV Libraries to link
  TARGET_LINK_LIBRARIES (${PROJ_NAME} ${OpenCV_LIBS})
  
  LINK_DIRECTORIES(
      ${LIBRARY_OUTPUT_PATH}
  )
  </code></pre>