由于预编译文件重复,导致下面的类没有被编译,所以,在写代码的时候也没有提示还报错,说LoadingScene没有定义。

#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" class HelloWorld : public cocos2d::Layer
{
public:
static cocos2d::Scene* createScene(); virtual bool init(); // a selector callback
void menuCloseCallback(cocos2d::Ref* pSender); // implement the "static create()" method manually
CREATE_FUNC(HelloWorld);
}; #endif // __HELLOWORLD_SCENE_H__
#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__ #include "cocos2d.h" class LoadingScene : public cocos2d::Layer
{
public:
// there's no 'id' in cpp, so we recommend returning the class instance pointer
static cocos2d::Scene* createScene(); // Here's a difference. Method 'init' in cocos2d-x returns bool, instead of returning 'id' in cocos2d-iphone
virtual bool init(); // implement the "static create()" method manually
CREATE_FUNC(LoadingScene);
virtual void onEnter() override;
virtual void onExit() override; private:
float progressPercent = 0.0f;
float everyAdd = 5.0f;
cocos2d::ProgressTimer *loadProgress = nullptr;
cocos2d::LabelTTF* loadLabel;
cocos2d::LabelTTF* percentLabel;
void preloadResource();
void progessAdd();
void loadingCallback (cocos2d::Texture2D*);
}; #endif // __LoadingScene_SCENE_H__

! cocos2d 预编译重复的更多相关文章

  1. 利用预编译解决C/C++重复定义的错误 -2020.09.13

    利用预编译解决C/C++重复定义的错误 -2020.09.13 我们现在有main.c和function.h两个文件 main.c #include <stdio.h> #include ...

  2. VS2010遇到fatal error C1083: 无法打开预编译头文件:“xxx.pch”: No such file or directory

    对C++和VS2010非常不熟悉,但是无奈赶着项目,只能看了点基础就上手,然后就碰到这个问题了. 原因分析: http://bbs.csdn.net/topics/340191697?page=1 编 ...

  3. iOS中的预编译指令的初步探究

    目录 文件包含 #include #include_next #import 宏定义 #define #undef 条件编译 #if #else #endif #if define #ifdef #i ...

  4. JS的预编译和执行顺序 详析(及全局与局部变量)

    最近在复习javascript的事件处理时发现了一个问题,于是总结一下:javascript的预编译和执行顺序的问题:   <html> <head> <title> ...

  5. PHP mysqli 扩展库(面向对象/数据库操作封装/事务控制/预编译)

    1.和mysql扩展库的区别: (1   安全性.稳定性更高 (2  提供了面向对象和面向过程两种风格 2.php.ini  中的  extension=php_mysqli.dll 解除封印 3.面 ...

  6. atitit.查看预编译sql问号 本质and原理and查看原生sql语句

    atitit.查看预编译sql问号 本质and原理and查看原生sql语句 1. 预编译原理. 1 2. preparedStatement 有三大优点: 1 3. How to look  gene ...

  7. C中的预编译宏定义

     可以用宏判断是否为ARC环境 #if _has_feature(objc_arc) #else //MRC #endif C中的预编译宏定义 -- 作者: infobillows 来源:网络 在将一 ...

  8. C/C++中的预编译指令

    工作中遇到的: 一个头文件中的: #pragma warning(disable:4996)#pragma warning(disable:4244)#pragma warning(disable:4 ...

  9. 深入理解include预编译原理

    http://ticktick.blog.51cto.com/823160/596179 你了解 #include 某个 .h 文件后,编译器做了哪些操作么? 你清楚为什么在 .h文件中定义函数实现的 ...

随机推荐

  1. 关于Unity3D中Resources动态加载NGUI图片的方法

    在NGUI中有些图片我需要动态进行变更或者加载,怎么办? 首先在项目中创建一个Resources目录,接着把需要的图片放在这里面,可以有子文件夹么?当然可以,文件结构很重要哦~ NGUI加载图片的方法 ...

  2. Coursera台大机器学习技法课程笔记02-Dual Support Vector Machine

    这节课讲的是SVM的对偶问题,比较精彩的部分:为何要使用拉格朗日乘子以及如何进行对偶变换. 参考:http://www.cnblogs.com/bourneli/p/4199990.html http ...

  3. python-twisted系列(1)

    前言: 这不是一个入门教程.而是知识点的梳理. 开胃图: 这是一个TCP server的“交互图”. reactor 它是Twisted事件处理的核心.包括一些处理网络通讯,线程和事件分派的接口. 一 ...

  4. 二模 06day2

    很长时间没更新有意义的题目了呢,这是一套题撒,于是乎我便开心的边刷题边发题解了撒. 第一题: interval 比较好玩的一题撒, 分分钟过了, 就是模拟贪吃蛇但是没有食物(嗯,只要你判断冲突). 整 ...

  5. 在CI中集成phpmailer,方便使用SMTP发送邮件

    直接使用phpmailer的话,有时候不是很方便,特别你的很多功能都是基于CI完成的时候,要相互依赖就不方便了,所以在想,那是否可以将phpmailer集成到CI中呢,像使用email类这样使用他,功 ...

  6. 【leetcode】Sudoku Solver

    Sudoku Solver Write a program to solve a Sudoku puzzle by filling the empty cells. Empty cells are i ...

  7. ubuntu 13.10 amd64安装ia32-libs

    很多软件只有32位的,有的依赖32位库还挺严重的:从ubuntu 13.10已经废弃了ia32-libs,但可以使用多架构,安装软件或包apt-get install program:i386.有的还 ...

  8. UVALive 7267 Mysterious Antiques in Sackler Museum (判断长方形)

    Sackler Museum of Art and Archaeology at Peking University is located on a beautiful site near the W ...

  9. UESTC 1215 (思维题 旋转)

    Secrete Master Plan Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Othe ...

  10. Jam的计数法(codevs 1140)

    题目描述 Description Jam是个喜欢标新立异的科学怪人.他不使用阿拉伯数字计数,而是使用小写英文字母计数,他觉得这样做,会使世界更加丰富多彩.在他的计数法中,每个数字的位数都是相同的(使用 ...