Box2D: 错误variable length array of non-POD element type 'b2Vec2'
来源:互联网 发布:c语言五子棋游戏源代码 编辑:程序博客网 时间:2024/05/18 10:03
Variable length of non-POD element type 'b2Vec2'!!怎么会报出这个错误呢?
真有点儿搞不懂了,刚进入ios开发的时候用的是一个朋友的mac笔记本
他的系统是雪豹的,在雪豹的XCode下面我记得是一点儿问题都没有的,警告也就是某某变量声明过后未被使用
蛋疼了,再看代码,操了,标准的c、c++写法啊...
在栈上定义一个b2Vec2数组也不行,不兴这样的吧?!如下图所示:
自打用上狮子以来,这个问题烦扰我好几次了,虽然项目能够正常编译通过并执行
但我就是觉得不爽,明明没错的东西还给报错,这不等于混淆视听么!!
前几天观摩别人的项目的时候不能正常运行,我在项目文件中重新设置了一下项目的编译器,竟然达到了我的目的~
想到这儿反正我也没有别的办法了,不如死马当做活马医,于是也改了一下编译器,
将编译器由 "LLVM GCC 4.2" 改成了 "GCC 4.2",没想到竟然也奏效了
下面是更改过之后重新运行时的IDE 界面
混淆试听的鸡肋错误提示被赶走了,仿佛大热天里啃上一根老冰棒,爽!
当然,这只是表面现象,其实还是有必要探讨一下为什么会出现这样的错误的:
如第二张图中所示,其实xcode的编译器总共有3种:
1.Apple LLVM compiler 2.1
2.GCC 4.2
3.LLVM GCC 4.2
iOS5结构体编译严格
问题描述:今天二罗升级iOS SDK5,发现Monster不能编译了。具体报错信息如下:
variable length array of non-POD element type 'b2Vec2'
问题分析:错误指向的是cocos2d里一个结构体数组定义,如下:
b2Vec2 vertices[vertexCount];
问题解决:把其改成指针形式,如下:
b2Vec2 *vertices = new b2Vec2[vertexCount];
- Box2D: 错误variable length array of non-POD element type 'b2Vec2'
- Box2D: 错误variable length array of non-POD element type 'b2Vec2'
- Variable length of non-POD element type 'b2Vec2'可能原因之一
- cannot pass objects of non-POD type
- warning:cannot pass objects of non-POD type
- warning:cannot pass objects of non-POD type
- ThinkPHP5错误解析之variable type error:array
- ThinkPHP5错误解析之variable type error:array
- variable type of buffer_handle_t
- variable-size type declared outside of any function错误说明
- 抓狂的c++错误:...which is of non-class type..
- 编译错误:error: invalid initialization of non-const reference of type ‘*&’ from a temporary of type
- array element has incomplete type
- 移植错误mach-mini2440.c array type has incomplete element type
- error: array type has incomplete element type
- Debug : array type has incomplete element type
- lots of "GET variable length limit exceeded"
- php 错误cannot-use-object-of-type-stdclass-as-array
- DatagramPacket与DatagramSocket
- Head First 十二 十三
- 例解 autoconf 和 automake 生成 Makefile 文件
- ubuntu连接windows的工具:rdesktop
- 数字 字符串转换
- Box2D: 错误variable length array of non-POD element type 'b2Vec2'
- 博客已经搬家。。。。欢迎来踩踩!
- 差分约束
- 插入排序
- 【原创】map容器自定义排序
- C#中ToString格式大全
- Win7发布后的web不能访问解决
- 数组的引用的用途
- shell iterate the directory in recursive way