Thursday, 15 August 2013

objective c - Xcode: Impossible to use c++ with Scenekit? -


I'm starting with Xcode ... I try to use OpenCV c ++ with the sycrack => I am doing the scene. Well, I was very optimistic.

1 / I started using the default excel templates for games. => Works!

2 / OpenCV without scenekit => works

3 / mixing ...

I have imported some C + headers in the gameviewController file (the original A UIViewController with interiors in the form)

If I do this, then I am compiler error (not defined cstddef) is appropriate, it is C ++, so what I have read, I have to change its name. Me MM but, in this case, I have found a complete list of linker errors such as the undefined symbols for architecture 64: "_OBJC_CLASS _ $ _ SCNAction", referenced from:

=> I think the purpose is C Combining C ++ and working on a simple project without any script, but with a very similar code, it works well.

> Guide to any clues or mix them? Should I use it fast?

Thank you very much,

Michael

same problem Here I had a pure purpose-class, which was simply named "GameviewControlor.M". To convert it to the OBJ-C ++ class, change ".m" to ".mm"

However, by simply changing the extension, the linker returned 13 undefined symbols ....

  "_OBJC_CLASS _ $ _ SCNTransaction", referenced from: .. Referenced from "_OBJC_CLASS _ $ _ SCNFloor", ... ... "_OBJC_CLASS _ $ _ SCN Content", referenced from: ... etc ...  

get around this For, just create a separate (new) Obj-C ++ class, in which. MM extension, and keep your C ++ code in that class Now you can instantiate that new class from the square of the SceneKit call and call the new Obj-C ++ class.

Within the GameViewcontroller.m class:

  ... view = [SCNScene view: @ "art.scnassets / grid.dae"]; Kinematics = [[kineticasken allok] init]; [Kinetics setup client]; ...  

and inside the new Obj-C ++ class (KinematicsScene.mm)

  @implementation KinematicScene {AI :: location * location; } - (id) init {self = [super init]; If (self) {AI :: kinetic seek = get = new AI :: kinetic seek [2]; Location = new AI :: location [2]; } Healthy return; } - (zero) Setup customer {.....} ... etc .... @end  

No comments:

Post a Comment