hi budy:
i just get CCScale9Sprite.h & CCScaleSprite.cpp from github, and add this 2 file to my new project.
i meet a strange compile error:
I use this way to construct a CCScaleSprite object
CCScale9Sprite sp = CCScale9Sprite::spriteWithFile;
addChild;
I think this 2 line is no wrong, i got misunderstand, please help.
——————————————————-
Undefined symbols for architecture i386:
“CCScale9Sprite::spriteWithFile(char const)", referenced from:
HelloWorld::init in HelloWorldScene.o
ld: symbol not found for architecture i386
clang: error: linker command failed with exit code 1
————————————————
#include “HelloWorldScene.h”
#include “SimpleAudioEngine.h”
#include “CCScale9Sprite.h”
using namespace cocos2d;
using namespace CocosDenshion;
CCScene** HelloWorld::scene()
{
// ‘scene’ is an autorelease object
CCScene scene = CCScene::node;
// ‘layer’ is an autorelease object
HelloWorldlayer = HelloWorld::node();
// add layer as a child to scene
scene->addChild(layer);
// return the scene
return scene;
}
// on”init" you need to initialize your instance
bool HelloWorld::init
{
//////////////////////////////
// 1. super init first
if )
{
return false;
}
CCScale9Sprite**sp = CCScale9Sprite::spriteWithFile(“Icon.png”);
addChild(sp);
return true;
}