deprecated-3d-engine-prototype icon indicating copy to clipboard operation
deprecated-3d-engine-prototype copied to clipboard

Compilation Error

Open kamend opened this issue 11 years ago • 13 comments
trafficstars

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

kamend avatar Apr 02 '14 12:04 kamend

please update ,This is a bug,I have modify it.

houguohua avatar Apr 02 '14 13:04 houguohua

I still get the same error with the latest version from GitHub.

kamend avatar Apr 02 '14 13:04 kamend

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);

}

}

houguohua avatar Apr 02 '14 13:04 houguohua

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?

kamend avatar Apr 02 '14 14:04 kamend

Removing the "cocos3d" group from the project and adding it again, fixed the problem. I guess the template project does not include all files.

kamend avatar Apr 02 '14 14:04 kamend

yes,you are right.the C3DDeviceAdapter_ios,mm is a new file last week,but the template is created last month.

houguohua avatar Apr 02 '14 14:04 houguohua

could you please push your code into the rep?

houguohua avatar Apr 02 '14 14:04 houguohua

I will merge your change

houguohua avatar Apr 02 '14 14:04 houguohua

It gives me access denied, any idea how to push without needing special permission?

kamend avatar Apr 02 '14 14:04 kamend

can you send a pull request to the cocos2d/cocos3d-x?

houguohua avatar Apr 02 '14 14:04 houguohua

have you fork the rep?

houguohua avatar Apr 02 '14 14:04 houguohua

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.

kamend avatar Apr 02 '14 14:04 kamend

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.

houguohua avatar Apr 02 '14 14:04 houguohua