Primitive not found

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Primitive not found

alexbor

Hello, everyone.

I'm currently trying to port a flash game on iphone using haxe + nme, and there are some problems.

I have a simple box2d based physics demo created to test iphone performance. In flash player it runs just perfectly, version for windows (hxcpp + nme) works but prints an error to console "Could not find primitive nme_stage_show_keyboard__2.", when trying to build for iphone (emulation) build succeeds but application is closed immediately after launch and the following is written to xcode console:

SetTopOfStack 0xbffff06c
Primitive not found : nme_stage_show_keyboard__2
Primitive not found : nme_stage_set_fixed_orientation__1
 Error Null Function Pointer
Program ended with exit code: 255

I have the latest trunk sources of hxcpp and nme on both windows and mac computers, development directories are set correctly.

XCode 4 project is generated using install-tool.

Could someone please tell me what i'm doing wrong?

Thank you, Alex.

PS: Sorry if it's a stupid question, may be that's because i'm not a c/c++ programmer, it's by the way one of the reasons to choose haxe as language to create iphone apps. :)
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

Jan_Flanders


On Sun, Aug 14, 2011 at 10:15 PM, alexbor <[hidden email]> wrote:
SetTopOfStack 0xbffff06c
Primitive not found : nme_stage_show_keyboard__2
Primitive not found : nme_stage_set_fixed_orientation__1
 Error Null Function Pointer
Program ended with exit code: 255


Thank you, Alex.

It seems to be missing. I commented that line in nme.display.Stage :
http://code.google.com/p/nekonme/source/browse/trunk/nme/display/Stage.hx#784
//  static var nme_stage_show_keyboard = nme.Loader.load("nme_stage_show_keyboard",2);

Jan

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

singmajesty
The libraries for iOS probably need to be rebuilt.

Open a terminal, then go to /nekonme/project and run these command:


haxelib run hxcpp Build.xml -DIPHONE
rm -r obj
haxelib run hxcpp Build.xml -DIPHONESIM


If it fails to compile, check .hxcpp_config.xml in your user directory and  
see if it is pointing to the right iOS SDK version.


I'll try and do this myself, in a little bit, to fix this problem.  
Whenever a new native method is added to something vital, like Stage, all  
of the native binaries need to be rebuilt. In the future, it would be cool  
if we had a build server that could generate these binaries for Windows,  
Mac OS, Linux, webOS, Android and iOS, but for now it has to be done  
manually for each environment and committed to SVN.



On Sun, 14 Aug 2011 13:27:04 -0700, Jan Flanders <[hidden email]> wrote:

> On Sun, Aug 14, 2011 at 10:15 PM, alexbor <[hidden email]> wrote:
>
>> SetTopOfStack 0xbffff06c
>> Primitive not found : nme_stage_show_keyboard__2
>> Primitive not found : nme_stage_set_fixed_orientation__1
>>  Error Null Function Pointer
>> Program ended with exit code: 255
>>
>>
>> Thank you, Alex.
>>
>
> It seems to be missing. I commented that line in nme.display.Stage :
> http://code.google.com/p/nekonme/source/browse/trunk/nme/display/Stage.hx#784
> //  static var nme_stage_show_keyboard =
> nme.Loader.load("nme_stage_show_keyboard",2);
>
> Jan


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

pparole
In reply to this post by alexbor
Hello

I try to compile a Xcode 4 generated project too, last svn version of hxcpp and nekonme.
I'm on Macosx 10.6.8, Xcode 4.0.2 IOS SDK 4.3 .

I'm exactly in the same situation than alexbor, i have rebuilt IOS librairies like Joshua said but still :
App launches, black screen and back to springboard.
I have uncommented some printf to follow what's wrong on console log and i have :

Starting ...
SetTopOfStack 0xbfffefcc
Running
Primitive not found : nme_stage_show_keyboard__2
Primitive not found : nme_stage_set_fixed_orientation__1
 Error Null Function Pointer
Program ended with exit code: 255

If someone can help, it will be great

Thank you, Pascal

and yes i have set IPHONE_VER=4.3 in the .hxcpp_config.xml of my Home User folder ;-)
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

alexbor
Pparole, I haven't tried to follow the steps myself but I've got a thought regarding you situation. Have you updated binaries in your xcode project? I've got that feeling that rebuilding nme doesn't take any effect, until you manualy copy newly built binaries to your project or just regenerate it with install tool.
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

pparole
Alex

If you think you ask stupid question, i assure you that you give very smart answer.
it worked for me, thank you a lot !
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

alexbor
In reply to this post by singmajesty
Thanks.

But in my case I had to use:
  haxelib run hxcpp Build.xml -Diphone -Diphoneos
  haxelib run hxcpp Build.xml -Diphone -Diphonesim

For some reason "haxelib run hxcpp Build.xml -DIPHONE" began building mac os binaries.
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

alexbor
In reply to this post by Jan_Flanders
By the way rebuilding windows binaries removed windows app error.
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

pparole
Now i try to compile for Iphone 4 mobile 4.3.3 and i have the same problem :
Starting ...
SetTopOfStack 0x2fdff47c
Running
Primitive not found : nme_stage_show_keyboard__2
Primitive not found : nme_stage_set_fixed_orientation__1
 Error Null Function Pointer
Program ended with exit code: 255

Of course this time i have rebuilt libraries for iphone :
haxelib run hxcpp BuildLibs.xml -Diphoneos in hxcpp/runtime folder

and
haxelib run hxcpp Build.xml -Diphoneos in nekonme/project folder

If you have another brillant idea, don't hesitate ...

Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

Alex Liebert
definitely for a device, and not simulator right? (or, you've also compiled the sim libraries with -Diphonesim) ?

On Wed, Aug 17, 2011 at 7:33 PM, pparole <[hidden email]> wrote:
Now i try to compile for Iphone 4 mobile 4.3.3 and i have the same problem :
Starting ...
SetTopOfStack 0x2fdff47c
Running
Primitive not found : nme_stage_show_keyboard__2
Primitive not found : nme_stage_set_fixed_orientation__1
 Error Null Function Pointer
Program ended with exit code: 255

Of course this time i have rebuilt libraries for iphone :
haxelib run hxcpp BuildLibs.xml -Diphoneos in hxcpp/runtime folder

and
haxelib run hxcpp Build.xml -Diphoneos in nekonme/project folder

If you have another brillant idea, don't hesitate ...



--
View this message in context: http://haxe.1354130.n2.nabble.com/Primitive-not-found-tp6685609p6697936.html
Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org


--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

pparole
Absolutely, for the simulator it works , now i try for my iphone 4 and it reacts like for the simulator before but this time i have updated the libraries

in hxcpp/bin/iPhone folder, the followings are updated :

libregexp.iphoneos.a
libstd.iphoneos.a
libzlib.iphoneos.a


and in nekonme/ndll/iPhone it's

libnme.iphoneos.a


the other libs comes from snv nekonme
libcurl.iphoneos.a
libjpeg.iphoneos.a
libpng.iphoneos.a
libz.iphoneos.a
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

Gamehaxe
In reply to this post by pparole
Hi,
Have you updated the libraries in your xcode project by copying the new  
ones?
haxelib run nme update proj.nmml iphone
should do this.

Hugh

> Now i try to compile for Iphone 4 mobile 4.3.3 and i have the same  
> problem :
> Starting ...
> SetTopOfStack 0x2fdff47c
> Running
> Primitive not found : nme_stage_show_keyboard__2
> Primitive not found : nme_stage_set_fixed_orientation__1
>  Error Null Function Pointer
> Program ended with exit code: 255
>
> Of course this time i have rebuilt libraries for iphone :
> haxelib run hxcpp BuildLibs.xml -Diphoneos in hxcpp/runtime folder
>
> and
> haxelib run hxcpp Build.xml -Diphoneos in nekonme/project folder
>
> If you have another brillant idea, don't hesitate ...
>
>
>
> --
> View this message in context:  
> http://haxe.1354130.n2.nabble.com/Primitive-not-found-tp6685609p6697936.html
> Sent from the Haxe mailing list archive at Nabble.com.

--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Primitive not found

pparole
Hi Gamehaxe

So obvious... it won't happen to me twice, thanks a lot