Xcode12.5中 .m转.cpp报错

2021-06-07  本文已影响0人  Mr_wick

在使用

xcrun -sdk iphoneos clang -arch arm64 -rewrite-objc main.m -o main-arm64.cpp

讲.m文件转为.cpp文件的过程中,出现如下报错:

xcrun: error: SDK "iphoneos" cannot be located
main.m:9:9: fatal error: 'UIKit/UIKit.h' file not found
#import <UIKit/UIKit.h>
        ^~~~~~~~~~~~~~~
main.m:9:9: note: did not find header 'UIKit.h' in framework 'UIKit' (loaded from '/System/Library/Frameworks')

如下图选择Command Line Tools 选择xcode版本号后,重新执行xcrun命令即可:


image.png
上一篇 下一篇

猜你喜欢

热点阅读