美文网首页
Xcode12.5中 .m转.cpp报错

Xcode12.5中 .m转.cpp报错

作者: Mr_wick | 来源:发表于2021-06-07 09:25 被阅读0次

    在使用

    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

    相关文章

      网友评论

          本文标题:Xcode12.5中 .m转.cpp报错

          本文链接:https://www.haomeiwen.com/subject/vcpzsltx.html