• 欢迎访问开心洋葱网站,在线教程,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站,欢迎加入开心洋葱 QQ群
  • 为方便开心洋葱网用户,开心洋葱官网已经开启复制功能!
  • 欢迎访问开心洋葱网站,手机也能访问哦~欢迎加入开心洋葱多维思维学习平台 QQ群
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏开心洋葱吧~~~~~~~~~~~~~!
  • 由于近期流量激增,小站的ECS没能经的起亲们的访问,本站依然没有盈利,如果各位看如果觉着文字不错,还请看官给小站打个赏~~~~~~~~~~~~~!

cocos2d-x项目 ISO C++ forbids declaration of "xxx"with no type [-fpermissive]XX

OC/C/C++ 开心洋葱 2994次浏览 0个评论

cocos2d-x项目 ISO C++ forbids declaration of "xxx"with no type [-fpermissive]XX

 

VS2012 编译运行cocos2d-x项目是可以的,在cygwin64里编译报错,如下

 

In  ^
In file included from jni/../../Classes/AppDelegate.cpp:2:0:
jni/../../Classes/GameScene.h:22:7: error: extra qualification 'GameScene::' on                                                                                                       member 'menuCloseCallback' [-fpermissive]
  void GameScene::menuCloseCallback(Object* pSender);
       ^
/cygdrive/f/yt/application/android-ndk-r9/build/core/build-binary.mk:348: recipe                                                                                                       for target 'obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.                                                                                                      o' failed
make: *** [obj/local/armeabi/objs/cocos2dcpp_shared/__/__/Classes/AppDelegate.o]                                                                                                       Error 1
make: Leaving directory '/cygdrive/f/yt/game/cocos2d-x-3.0alpha0-pre/projects/te                                                                                                      st/proj.android'
                                                                                               st/proj.android'

 

这是因为 在代码里 vs c++可以识别的代码在linux gcc下编译不识别  ,就找到 GameScene.h 22行处 把 原来的

void GameScene::menuCloseCallback(Object* pSender); 声明 改为 void menuCloseCallback(Object* pSender);就可以顺利的编译通过了


开心洋葱 , 版权所有丨如未注明 , 均为原创丨未经授权请勿修改 , 转载请注明cocos2d-x项目 ISO C++ forbids declaration of "xxx"with no type [-fpermissive]XX
喜欢 (0)

您必须 登录 才能发表评论!

加载中……