Quick question for newbie. I spend hours but can not fix this error.
helloworld
bool HelloWorld::init()
{
//////////////////////////////
// 1. super init first
if ( !Layer::init() )
{
return false;
}
abcLayer* gameLayer = abcLayer::createLayer();
//this->addChild(gameLayer);
return true;
}
abcLayer.h
#include <iostream>
#include "cocos2d.h"
class abcLayer : public cocos2d::Layer
{
public:
abcLayer();
~abcLayer();
static abcLayer* createLayer();
bool initLayer();
//CREATE_FUNC(abcLayer);
};
abcLayer.cpp
#include "abcLayer.h"
USING_NS_CC;
abcLayer::abcLayer()
{
}
abcLayer::~abcLayer()
{
}
abcLayer* abcLayer::createLayer()
{
abcLayer * pRet = new abcLayer();
if (pRet && pRet->initLayer())
{
pRet->autorelease();
return pRet;
}
else
{
delete pRet;
pRet = NULL;
return NULL;
}
}
bool abcLayer::initLayer()
{
if (!Layer::init())
{
return false;
}
return true;
}
linker error
ndefined symbols for architecture x86_64:
"abcLayer::createLayer()", referenced from:
HelloWorld::init() in HelloWorldScene.o
ld: symbol(s) not found for architecture x86_64
What is the problem -_-?