使用未声明的标识符'float32x2_t'(重新启动XCode后)

时间:2023-01-23 00:21:20

although I am quite new to the iOS development, I have some experience with C. And somehow I get a strange error for in my code after starting XCode today. The code worked fine yesterday and I did save the project properly.

虽然我对iOS开发很陌生,但是我对c有一定的经验,并且在今天开始运行XCode后,我的代码出现了一个奇怪的错误。代码昨天运行良好,我保存了项目。

In the code there are simply 2 points taken and a vector formed with it. Then it calculates the orthogonal vector and its length with the fast inverse sqrt. I took it from here (Fastest Inverse Square Root on iPhone) and this uses the float32x2t datatype.

在代码中有两个点和一个向量组成。然后用快速逆根号计算正交向量及其长度。我从这里取的(iPhone上最快的反平方根)它使用float32x2t数据类型。

But I get now this error message for it:

但是现在我得到了这个错误信息

Use of undeclared identifier 'float32x2_t'

使用未声明的标识符'float32x2_t'

The code:

代码:

CGPoint startPoint = [self transformPoint:[[copy objectAtIndex:i] CGPointValue]];
CGPoint endPoint = [self transformPoint:[[copy objectAtIndex:i+1] CGPointValue]];

GLKVector2 line = GLKVector2Make((endPoint.x - startPoint.x), (endPoint.y - startPoint.y));
GLKVector2 lineOrthogonal = GLKVector2Make(line.y, -line.x);

float32x2_t floatVector = {powf(lineOrthogonal.x, 2.0) + powf(lineOrthogonal.y, 2.0), 1.0f};
float32x2_t invsqrt = vrsqrte_f32(floatVector);

So how does this error message come and how do I fix it?

这个错误信息是怎么来的,我怎么修复它呢?

1 个解决方案

#1


0  

Ok, I found the answer by myself. It seems that an update of something within Xcode or the bad connection to the actual testing device on the USB-controller switched back the running device to the built-in simulators. And they don't understand the float32x2_t datatype, but the real device does.

好的,我自己找到了答案。似乎在Xcode中更新某个内容或连接到USB-controller的实际测试设备的错误连接时,将正在运行的设备切换回内置的模拟器。他们不理解float32x2_t数据类型,但真正的设备理解。

But why is it like this?

但为什么会是这样呢?

#1


0  

Ok, I found the answer by myself. It seems that an update of something within Xcode or the bad connection to the actual testing device on the USB-controller switched back the running device to the built-in simulators. And they don't understand the float32x2_t datatype, but the real device does.

好的,我自己找到了答案。似乎在Xcode中更新某个内容或连接到USB-controller的实际测试设备的错误连接时,将正在运行的设备切换回内置的模拟器。他们不理解float32x2_t数据类型,但真正的设备理解。

But why is it like this?

但为什么会是这样呢?