Note that there are some explanatory texts on larger screens.

plurals
  1. POerror: expected unqualified-id before 'not' token g c++ builder
    primarykey
    data
    text
    <p>I have a class Notification in program and I use it in other class in this project. It ok when I run in Visual studio 2010. But when use Cygwin build occcur this error " error: expected unqualified-id before 'not' token" This my class File .h </p> <pre><code>#ifndef __TOAST_H__ #define __TOAST_H__ #include "cocos2d.h" #include "cocos-ext.h" USING_NS_CC_EXT; USING_NS_CC; #define LOADING 1 class notificationTOAST: public CCLayer{ public: notificationTOAST(char* bg, char* txt, float y, float duringTime, CCObject* target); notificationTOAST(char* bg, char* txt, float y, float duringTime, CCObject* target,char* imgLoading); notificationTOAST(char* bg, char* txt, float duringTime, CCObject* target); notificationTOAST(char* bg, char* txt, float x, float y, float duringTime, CCObject* target); notificationTOAST(char* bg, char* txt,float x, float y, float duringTime, CCObject* target,char* imgLoading); void end(); virtual void loop(float id); private: float duringTime; CCObject* target; }; #endif </code></pre> <p>File .cpp</p> <pre><code>#include "Toast.h" #include "Constant.h" notificationTOAST::notificationTOAST(char* bg, char* txt, float y, float duringTime, CCObject* target){ this-&gt;target = target; CCLabelTTF *text = CCLabelTTF::create(txt, font_arial, 20); text-&gt;setPosition(ccp(SCREEN_W/2, y)); addChild(text,1); CCScale9Sprite* background = CCScale9Sprite::create(bg); background-&gt;setContentSize(CCSizeMake(text-&gt;getContentSize().width + 40, text-&gt;getContentSize().height +20)); background-&gt;setPosition(ccp(SCREEN_W/2, y)); addChild(background); this-&gt;duringTime = duringTime; if(duringTime &gt; 0){ schedule(schedule_selector(notificationTOAST::loop)); } this-&gt;runAction(CCFadeIn::create(0.3f)); this-&gt;autorelease(); } notificationTOAST::notificationTOAST(char* bg, char* txt, float x, float y, float duringTime, CCObject* target){ this-&gt;target = target; CCLabelTTF *text = CCLabelTTF::create(txt, font_arial, 20); text-&gt;setPosition(ccp(x, y)); addChild(text,1); CCScale9Sprite* background = CCScale9Sprite::create(bg); background-&gt;setContentSize(CCSizeMake(text-&gt;getContentSize().width + 40, text-&gt;getContentSize().height +20)); background-&gt;setPosition(ccp(x, y)); addChild(background); this-&gt;duringTime = duringTime; if(duringTime &gt; 0){ schedule(schedule_selector(notificationTOAST::loop)); } this-&gt;runAction(CCFadeIn::create(0.3f)); this-&gt;autorelease(); } notificationTOAST::notificationTOAST(char* bg, char* txt, float y, float duringTime, CCObject* target,char* imgLoading){ this-&gt;target = target; CCLabelTTF *text = CCLabelTTF::create(txt, font_arial, 20); CCSprite* loading = CCSprite::create("progress.png"); int w = text-&gt;getContentSize().width + loading-&gt;getContentSize().width + 5; int h = loading-&gt;getContentSize().height; loading-&gt;setPosition(ccp(SCREEN_W/2 - w/2 + loading-&gt;getContentSize().width/2,y)); CCActionInterval* rotage = CCRotateBy::create(2.0f, 360); loading-&gt;runAction(CCRepeatForever::create(rotage)); addChild(loading,1,LOADING); text-&gt;setPosition(ccp(SCREEN_W/2 - w/2 + loading-&gt;getContentSize().width + text-&gt;getContentSize().width/2 + 5, y)); addChild(text,1); CCScale9Sprite* background = CCScale9Sprite::create("bgloading.png"); background-&gt;setContentSize(CCSizeMake(w + 10, h)); background-&gt;setPosition(ccp(SCREEN_W/2, y)); addChild(background); this-&gt;duringTime = duringTime; if(duringTime &gt; 0){ schedule(schedule_selector(notificationTOAST::loop)); } this-&gt;runAction(CCFadeIn::create(0.1f)); this-&gt;autorelease(); } notificationTOAST::notificationTOAST(char* bg, char* txt,float x, float y, float duringTime, CCObject* target,char* imgLoading){ this-&gt;target = target; CCLabelTTF *text = CCLabelTTF::create(txt, font_arial, 20); CCSprite* loading = CCSprite::create("progress.png"); int w = text-&gt;getContentSize().width + loading-&gt;getContentSize().width + 5; int h = loading-&gt;getContentSize().height; loading-&gt;setPosition(ccp(SCREEN_W*2/3 - w/2 + loading-&gt;getContentSize().width/2,y)); CCActionInterval* rotage = CCRotateBy::create(2.0f, 360); loading-&gt;runAction(CCRepeatForever::create(rotage)); addChild(loading,1,LOADING); text-&gt;setPosition(ccp(SCREEN_W*2/3 - w/2 + loading-&gt;getContentSize().width + text-&gt;getContentSize().width/2 + 5, y)); addChild(text,1); CCScale9Sprite* background = CCScale9Sprite::create("bgloading.png"); background-&gt;setContentSize(CCSizeMake(w + 10, h)); background-&gt;setPosition(ccp(SCREEN_W*2/3, y)); addChild(background); this-&gt;duringTime = duringTime; if(duringTime &gt; 0){ schedule(schedule_selector(notificationTOAST::loop)); } this-&gt;runAction(CCFadeIn::create(0.1f)); this-&gt;autorelease(); } notificationTOAST::notificationTOAST(char* bg, char* txt, float duringTime, CCObject* target){ this-&gt;target = target; CCLabelTTF *text = CCLabelTTF::create(txt, font_arial, 20); CCScale9Sprite* background = CCScale9Sprite::create(bg); background-&gt;setPosition(ccp(SCREEN_W/2,SCREEN_H- background-&gt;getContentSize().height/2)); addChild(background); int w = background-&gt;getContentSize().width; int h = background-&gt;getContentSize().height; text-&gt;setPosition(ccp(SCREEN_W + text-&gt;getContentSize().width/2, SCREEN_H-h/2)); addChild(text,1); CCFiniteTimeAction* seq = CCSequence::create(CCMoveBy::create(20,CCPointMake(-(SCREEN_W + text-&gt;getContentSize().width + 50),0)), CCMoveTo::create(0,CCPointMake(SCREEN_W + text-&gt;getContentSize().width/2, SCREEN_H-h/2)), NULL); text-&gt;runAction(CCRepeatForever::create((CCActionInterval*)seq)); this-&gt;duringTime = duringTime; if(duringTime &gt; 0){ schedule(schedule_selector(notificationTOAST::loop)); } this-&gt;autorelease(); } void notificationTOAST::loop(float id){ if(duringTime == -1) return; duringTime -= id; if(duringTime &lt;= 0){ duringTime = 10; //this-&gt;stopAllActions(); CCLayer* aLayer = (CCLayer*) target; aLayer-&gt;removeChild(this); } } void notificationTOAST::end(){ CCLayer* aLayer = (CCLayer*) target; aLayer-&gt;removeChild(this); } </code></pre> <p>I call it in other function follow:</p> <pre><code>notificationTOAST *not = new notificationTOAST("","Loading...",SCREEN_W/2 ,SCREEN_H/2+50,3,GameController::getInstance(),""); not-&gt;setTag(100); GameController::getInstance()-&gt;addChild(not);` </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload