1

I am new to iOS, I just tried to build my Unity game for iOS and it gives me these errors. See image. Can someone help? Please

  1. Typedef redefinition with different types ('NSUInteger' (aka 'unsigned long') vs 'enum MTLPixelFormat')
  2. Redefinition of enumerator 'MTLPixelFormatBGRA8Unorm'
  3. Redefinition of enumerator 'MTLPixelFormatBGRA8Unorm_sRGB'
Omer Mujtaba
  • 21
  • 1
  • 9
  • Post your code. It sounds like you're using "Objective-C++" (mixed Objective-C and C++ syntax) – Duncan C Oct 20 '17 at 18:33
  • I fixed it by just commenting the code, but now having new errors. Please see this if you can help. [link] (https://stackoverflow.com/questions/46864491/unidentified-symbol-for-architecture-arm64-xcode-9) – Omer Mujtaba Oct 21 '17 at 14:48

2 Answers2

0

This error is raised as your project is using Metal.framework and iOS simulator does not support metalframework. If you run your project on iphone device it will run fine.

Nirbhay Singh
  • 1,204
  • 1
  • 12
  • 16
0

To fix this problem simply comment out the offending lines.

//typedef NSUInteger MTLPixelFormat;
//enum
//{
//    MTLPixelFormatBGRA8Unorm,
//    MTLPixelFormatBGRA8Unorm_sRGB,
//};

(Source)

Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
Aaron Small
  • 1,682
  • 1
  • 11
  • 6