Search code examples
iosiphonexcodeunity-game-enginexcode10

Unity3D exported source : c++ header files not recognised


Unity3D 4.7.2 exported source worked perfect in Xcode 9.

Same code gave file not found error in latest Xcode 10.1

#include <algorithm> // Got error here saying file not found.

So I just changed C++ Standard Library to libc++(LLVM C++ standard library)

enter image description here

After this change all compiler errors gone.... got lots of linker error for c++

enter image description here

How to solve these errors ?


Solution

  • As Programmer suggested, libc++ removed from Xcode 10.

    Simplest work around is to copy it from Xcode 9.4

    Copy c++ from

    /Applications/Xcode9.4.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/c++  to Xcode10 the same path

    Also copy libstdc++.tbd, libstdc++.6.tbd and libstdc++.6.0.9.tbd in /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib.

    In Xcode Build Settings, keep C++ Standard Library as libstdc++.