deprecated-3d-engine-prototype
deprecated-3d-engine-prototype copied to clipboard
Compilation Error
Trying to compile a new project, right out of the box, gives the following error:
Undefined symbols for architecture i386: "cocos3d::C3DDeviceAdapter::getInstance()", referenced from: cocos3d::C3DRenderSystem::C3DRenderSystem() in C3DRenderSystem.o
I am using latest XCode 5.1 version on OSX Mavericks
please update ,This is a bug,I have modify it.
I still get the same error with the latest version from GitHub.
Please check cocos3d/C3DDeviceAdapter_ios.mm file Is it the same as the following code?
namespace cocos3d { C3DDeviceAdapter* C3DDeviceAdapter::_deviceAdapterInstance = NULL;
C3DDeviceAdapter* C3DDeviceAdapter::getInstance()
{
if ( _deviceAdapterInstance == NULL )
{
_deviceAdapterInstance = new C3DDeviceAdapter();
_deviceAdapterInstance->autorelease();
}
return _deviceAdapterInstance;
}
void C3DDeviceAdapter::checkCpuInfo() { size_t size = sizeof(int);
int mib[2] = {CTL_HW, HW_NCPU};
sysctl(mib, 2, &_cpuCount, &size, NULL, 0);
WARN_VARG("default set the cpu counter of pc is : %d", _cpuCount);
}
}
Yes, it looks like this, but I still get the error. I have used the project-creator script to create the templates and I noticed that the C3DDeviceAdapter_ios.mm is not added to the project, may be an error in the project template?
Removing the "cocos3d" group from the project and adding it again, fixed the problem. I guess the template project does not include all files.
yes,you are right.the C3DDeviceAdapter_ios,mm is a new file last week,but the template is created last month.
could you please push your code into the rep?
I will merge your change
It gives me access denied, any idea how to push without needing special permission?
can you send a pull request to the cocos2d/cocos3d-x?
have you fork the rep?
Ok, I will fork and edit the template and push, but it will be a little bit later. All I needed to do is add the cocos3d group again, so you will probably fix it faster then me.
ok,I will do it tomorrow.Because my work computer is in the company,and now I am in my home. Thank you very mush.