Game Development Community

"Unable to instantiate non-conobject class" Error

by Chris W Hill · in iTorque 2D · 01/24/2011 (1:59 pm) · 1 replies

I am attempting to get the iT2D projects to compile and run on my iPad. Currently I have been able to get the application to compile by modifying XCode's settings to the following:

On iTorque2DGame_device target:
Changed base SDK to 'Latest IOS'
Changed GCC to 4.2
Targeted Device Family: iPad
iOS Deployment Target: iOS 4.2

The game loads, with a bunch of these (benign, i think) errors:
exec: Found an old DSO (/private/var/mobile/Applications/7FE336D2-04CB-4B29-A5AC-110B9ECA300B/iTorque2DGame.app/common/scripts/SoundManager.cs.dso, ver 42 < 43), ignoring. 
Executed /private/var/mobile/Applications/7FE336D2-04CB-4B29-A5AC-110B9ECA300B/iTorque2DGame.app/common/scripts/SoundManager.cs. Took 12 ms


And then I get a EXC_BAD_ACCESS if the following line is run in projectManagement.cs:
%userDatablockFile = expandFilename("game/scripts/datablocks.cs");

The full error (from gdb when running on device):
Warning: (/Applications/iTorque2D_1_4/MyProjects/AquaTest1/buildFiles/XCode_iPhone/../../../../engine/source/console/consoleObject.cc @ 74) Couldn't find class rep for dynamic class: game/scripts/datablocks.cs 
game/scripts/datablocks.cs (0): Unable to instantiate non-conobject class game/scripts/datablocks.cs. 
Program received signal:  &acirc;€śEXC_BAD_ACCESS&acirc;€ť.

My thought is that this is an issue with my compilation settings. I cannot figure out what exactly, but me and a friend's 'hunch' is that something is not getting linked correctly. Does anyone have any idea what's going on?

Any help is much appreciated!

#1
01/24/2011 (4:22 pm)
Figured it out. It is not an issue with my compilation settings at all, its a scripting error in the default project. :(

Essentially this is a TorqueScript null exception. It couldn't find the file and it was nulling out. By creating a 'game/scripts/datablocks.cs' file and inputting a test datablock fixed the problem. Alternatively this line may be commented out:

%userDatablockFile = expandFilename("game/scripts/datablocks.cs");