简体   繁体   English

尝试将PanoramaGL添加到静态库时,未知类型名称“CGFloat”

[英]Unknown type name 'CGFloat' when try to add PanoramaGL to the static library

I try to use panoramaGL framework and try to add it to my static library. 我尝试使用panoramaGL框架并尝试将其添加到我的静态库中。 So I've imported it to the project, add CoreGraphics framework but have an issue Unknown type name 'CGFloat' in PLStructs.h. 所以我已经将它导入到项目中,添加了CoreGraphics框架,但是在PLStructs.h中有一个Unknown type name 'CGFloat'的问题。 When I Cmd+click on the CGFloat in Xcode - I go to the CGBase.h in CoreGraphics framework. 当我Cmd +点击Xcode中的CGFloat时 - 我转到CoreGraphics框架中的CGBase.h Try to clean the project and replace the frameworks - the result is the same. 尝试清理项目并替换框架 - 结果是一样的。 Waiting for your help. 等待你的帮助。

解决方案很简单:

#import <UIKit/UIKit.h>

Also don't need a full CoreGraphics.h. 也不需要一个完整的CoreGraphics.h。 This is enough: 这就够了:

#import <CoreGraphics/CGBase.h>

You actually don't need to import the full UIKit . 您实际上不需要导入完整的UIKit This is enough: 这就够了:

#import <CoreGraphics/CoreGraphics.h>

The same problem came for me in Cocos2D. 在Cocos2D中我遇到了同样的问题。

The solution is 解决方案是

  1. Go to build settings. 转到构建设置。 In Architectures field you might have "Standard architectures (armv7, armv7s, arm64). Architectures领域,您可能拥有“标准架构(armv7,armv7s,arm64)”。

  2. The main cause for the problem is arm64. 问题的主要原因是arm64。 So the best way is to use " armv7 " in the field. 所以最好的方法是在现场使用“ armv7 ”。

  3. We keep the standard architecture as is n " valid architectures " 我们将标准架构保持为“ 有效架构

Hope it helps. 希望能帮助到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM