1

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 ?

Kerberos
  • 4,036
  • 3
  • 36
  • 55
Guru
  • 21,652
  • 10
  • 63
  • 102
  • Wrap `#include ` around `__cplusplus` to make sure that it's not included in your Object-C files since algorithm is only for C++ or Object-C++. Replace `#include ` **with** `#ifdef __cplusplus #include #endif` – Programmer Nov 15 '18 at 18:03
  • I only asked you do that on algorithm not on csignal. I can't answer your last question since I barely use xcode. It will be better for you to update your question with your new problem so that anyone who wish to help will know where to start – Programmer Nov 15 '18 at 18:22
  • @Programmer for algorithm also same error https://app.box.com/s/wjr7bb2wbc01240hncdg13hl4go6yw4n – Guru Nov 15 '18 at 18:27
  • 1
    Your last screenshot shows libC++ error and this is due to its deprecation in Xcode 10. You need to read [this](https://stackoverflow.com/questions/51060596/ld-library-not-found-for-lstdc-6) – Programmer Nov 15 '18 at 20:36
  • @Programmer Thanks a lots for finding our right problem, you are right, libc++ removed in Xcode 10. I just copied it from Xcode 9.4 to Xcode 10.1 and then everything worked perfect. – Guru Nov 16 '18 at 05:21
  • 1
    You're welcome! – Programmer Nov 16 '18 at 05:25

1 Answers1

2

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++.

Guru
  • 21,652
  • 10
  • 63
  • 102