Haxe, iPhone & C++ At Last

Hxcpp 1.0, neash 1.0, NME 1.0

The release this week of haXe version 2.0.4 officially includes c++ as a build target, for Windows, Mac, Linux and iPhone. You can download and install from haxe.org. In addition to the standard includes, you will need the “hxcpp” library, which can be insatlled with the included haxelib management tool.

Coincident with the hxcpp release, I have updated the neash and NME libraries to versions 1.0. You can also download these via the haxelib tool too. There are several incrental improvements, and the iPhone target has been added!

Getting started with the iPhone

Getting started with the iPhone is quite tricky at the moment, mainly because of the pain of setting up an Xcode project. Also, getting the simplest program onto the device is hard due to the code signing requirements. So if you can already get one of the existing application templates to work, you are half way there.

Note that this solution uses the “SDL” library, and must statically link against this. SDL is covered by the LGPL license, and this has implications should you choose to release your software. I am hoping to remove the LGPL restiction at a later date.

The binaries used here are have been compiled for the “2.2.1″ iPhone SDK. So choose this version when compiling for simulator or device.

  1. Download and install components
    • Get haxe & neko: Visit haxe.org
    • Get hxcpp: haxelib install hxcpp
    • Get nme: haxelib install nme
    • Get neash: haxelib install neash
    • Get the sdl-static libs for iphone: I have created a project with binary builds of these. You can get the latest builds directly from subversion svn code at:
      http://code.google.com/p/sdl-static/source/checkout.
      Or get the snapshot bundle from this site and install somewhere handy:
      sdl-static-iphone-1.0.zip
  2. Get Xcode with iphone sdk support – visit apple.com
  3. Get a Developer key (you can try simulator without it). You will need to pay to sign up as a developer on the apple site.
  4. Fire up Xcode and do File > New Project.

    Choose iPhone OS > Application. Here choose a “Windows-Based Application
    but infact we will use the delegate setup in the SDL code, so we will have
    to delete the one created by the wizard.

    Select a name & directory for the project. I’m calling it “Haxe Test”.

    Now as it stands, you should be able to build for the Simulator and
    get a lovely white screen and a program called “Haxe Test” in the simulator
    start screen.

    Next thing is to delete(to trash) the “…AppDelegate.h” “…AppDelegate.m”,
    the “Nib Files” group, Resources/MainWindow.xib and “main.m”.
    Finally, select the “Haxe Test” executable (in the Targets section) and from the “Get Info” –
    “Properties” tab, clear the reference to “MainWindow”.

    We will add replacements for these soon.

  5. Add “main.cpp” from the NME project.
    Select the top-level project folder and then use Action > Add > Existing Files.
    It is probably in /usr/lib/haxe/lib/nme/1,0/ndll/iPhone/ or
    similar depending on which version of NME you have installed. It can be
    very painful to get xcode to load from this location, unless you hit
    Command-Shift-G at the “Add” dialog and type (at least some) of this filename in.
    Choose to “Copy to destinations folder” so
    that you can mess with it if you wish. Note: you need to have a cpp mainline
    in order to automatically link in the correct runtime libraries.

  6. Add the libNME.iphoneos.a and libNME.iphonesim.a files from the haxelib NME project.
    You can add them both and the linker
    will select the correct on depending on your build. They are in the same place
    as main.cpp, you you should be able to use “iPhone” from the pull-down box
    in the add dialog. Probably best not to copy these files – in case you want
    to change them at some stage.
  7. Add the whole sdl-static/lib/iPhone directory.
    Again probably best not to copy.
    I used the “Recursively create groups” option. These will be where you stored them
    in step 1.

  8. Add the whole hxcpp/bin/iPhone directory like above.
    Again, this will
    be in a path like /usr/lib/haxe/lib/hxcpp/1,0,2/bin/iPhone/.
  9. Add the hxcpp include directory to the include path.
    Use the “Info” button
    to get the project properties, and on the build tab, under “Search Paths”
    add something like /usr/lib/haxe/lib/hxcpp/1,0,2/include/ to “Header Search Path”
  10. Now we are ready for the haxe code. If you have and existing project,
    then you can adapt the following instructions.

    Create a new file from Xcode (Other/Empty File] Here I have called it “HaxeTest.hx”, and unticked the “Targets” option. I’m prety sure there is a way to get “Haxe File” to appear as on option here – but I don’t know the details.

    In the haxe file, enter something like (Note the window size):

    import flash.display.Sprite;
    import flash.display.Shape;
    
    class HaxeTest extends Sprite
    {
       
       public function new()
       {
          super();
          flash.Lib.current.addChild(this);
    
          var circle:Shape = new Shape( ); 
          circle.graphics.beginFill( 0xff9933 , 1 );
          circle.graphics.drawCircle( 0 , 0 , 40 );
          circle.x = 150;
          circle.y = 200;
          addChild( circle ); 
       }
    
       static public function main()
       {
          neash.Lib.mOpenGL = true;
          neash.Lib.Init("HaxeTest",320,480); 
          neash.Lib.SetBackgroundColour(0x447733); 
    
          new HaxeTest();
    
          neash.Lib.ShowFPS();
          neash.Lib.Run();
       }
    }
    

    This is the “main” file for haxe, and the hxcpp compile will create a library matching
    this class name.

  11. Set up a build script to build changes you make to your haxe files into a library.
    Xcode has a few issues with a straight custom build script order due to incorrect
    dependency checking. This can be worked around by first adding a custom target.

    Highlight the “Targets” in the Groups & Files and use the “Action > Add > New Target..
    Choose “Other > Shell Script Target” and call it something like “Compile Haxe”.
    Close the pop-up and go back to the explorer. There should be a “Run Script”
    entry under the “Compile Haxe” target if you expand it out.

    Get info on “Run Scipt” and enter the following script

       if [ "$CURRENT_ARCH" = "i386" ]
       then
          haxe -main HaxeTest -cpp cpp -lib neash -lib nme  --remap neko:cpp --remap flash:neash -D iphonesim
       else
          haxe -main HaxeTest -cpp cpp -lib neash -lib nme  --remap neko:cpp --remap flash:neash -D iphoneos
       fi
    


    You can untick the “Show Environment” if you do not need to debug this.

    One last step – drag the “Compile Haxe” target into the “Haxe Test” target.
    It should now also show up as first item “under” the “Haxe Test” target.
    The build order should now be correct. (See image at end of post)

  12. Now you are ready to do the build. The first time you build, the build
    results will show “Running custom shell script…” for quite a while.
    Haxe compiles to cpp very quickly, but it take a while for the cpp files
    to compile to a library. You can see the progress if you expand out the
    middle tab bit.

    At this stage, you should get a bunch or errors when linking, but also haxe
    should have created a library for you. Add this library to the project -
    it should be in the local cpp/HaxeTest.iphonesim.a.

  13. Compiling now gets a bunch of unresolved functions from frameworks.
    Add the following frameworks to the project (Add > Existing Frameworks):
    • QuartzCore
    • OpenGLES
    • AudioToolbox

    These can be found in /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/System/Library/Frameworks/.

  14. Run!
    So you should be good to go. Open up the debug console so you can see
    any traces/printfs.

  15. Change the target to “Device – IPhone OS” from the pull-down and hit “Build and Go”.
    Again, this takes quite a while the first time.
    Now add the new cpp/HaxeTest.iphoneos.a library to the project.

  16. Now you need to sort out your code signing. If you have not done so already,
    setup you apple developer account & certificates on the apple web site.
    Go to the info of the “Haxe Test” executable and the “properties” tab.
    Change the “Identifier” to match one of your cerificates. Make sure to
    match your company URL. You may want to use “*” when creating your
    profile for easy changing.

    Under the “Build” tab, under the “Code Signing” bit
    in the “Any iPhone Device” pull down your profile. If you don’t have one then
    you will need to create one on the apple website.

  17. Connect up your iPhone(iPod touch) and build! W00t!

HaxeTest

I have had all sorts of errors when trying to upload to the device.
So far, they have been solved by getting out of the car, walking around it and getting back in.
ie, Disconnect and power down ipod. Fully exit Xcode and the start it all up and try again. Also, uninstalling the app from the “Windows > Orgainiser” directory can help.

But now the easy bit. Change to HaxeTest.hx file, and hit Build & Go. It is that simple.
Errors should show up nicely in xcode.

You can add data files (eg, pngs, xml etc) to the project and they will be copied to device so you can open them with a relative path.

In the properties of the “Info.plist” you can set a Icon File – don’t forget to add the icon to the project too.

Not covered here (because I have not fully sorted it out myself):

  • Syntax highlighting in XCode
  • Debug build (hxcpp can do then – it’s a matter of setting up Xcode)
  • Code completion in Xcode
  • Automating this procedure!

Edit: Add framework path, SDL version, MainWindow clearing.

This entry was posted in hxcpp, iphone, neash, nme and tagged , , , , , . Bookmark the permalink.

147 Responses to Haxe, iPhone & C++ At Last

  1. Huge says:

    Hi Idealprod,
    It seems strange indeed. Could you post the compile “gcc” command if you have not further luck.
    One thing it might be is a different SDK version. The standard hxcpp build system (int $HXCPP/build-tool/BuildCommon.xml) uses IPHONE_VER 2.2.1. If you do not have this installed on your system, this could explain the problem. Try changing this value to 3.0.0 and see if that fixes the problem. Alternatively, you may consider installing the older SDK – but only do this if the first options does not work.

    Hugh

  2. Aurel300 says:

    Well, it says the library Something.iphoneos.a (which I created sooner in haxe) is missing.

    And it is true. You sooner said I should delete the cpp directory, in which was the file located, and now, for some reason, the haxe compile script is not creating the library at all.

    How do I rebuild that library? (yes, I am very new to Xcode…)

  3. Idealprod says:

    I’m trying that and I’ll give you the gcc call if it doesn’t work.

    Is there a way to compile the SDL lib for the 3.1 iphone OS ? I’d like to make haXe programs for the very last iPhone version.

    Thanks !

  4. Idealprod says:

    Great !

    I’ve changed the iphone version to 3.0, and it’s working great.

    Can I target 3.1.2 with the SDL repos’ I downloaded ? What can I do if now ?

    Thanks !

  5. Hi Huge…

    I’ve been trying to get this working, and I ran into the hxObject.h issue. I changed it to hxcpp.h like advised. It then said it couldn’t find string.h, so I added “/usr/include” to my search for headers. This solved the missing “string.h” issues. But doing this, then got me another error:

    /usr/include/c++/4.0.0/cstdarg:57: error: ‘::va_list’ has not been declared

    I then tried a different to find an old SDK (no joy, yet!) – any news on making this stable?

    Cheers
    Simon

  6. This is the error I get…

    In file included from /usr/include/c++/4.2.1/tr1/cstdarg:37,
    from /usr/include/c++/4.2.1/tr1/stdarg.h:37,
    from /usr/include/stdarg.h:4,
    from /usr/include/wchar.h:111,
    from /usr/lib/haxe/lib/hxcpp/2,05,1/include/hxcpp.h:7,
    from /Users/simon/Documents/workspace/haxe/Haxe Test/main.cpp:1:
    /usr/include/c++/4.0.0/cstdarg:57: error: ‘::va_list’ has not been declared

  7. I’ve managed to get past that problem (am I going down the wrong path?), by adding

    #include

    in to the hxcpp.h above the “standard headers…”, which is great, except I’m now getting a lot of errors about the architecture. I will play around a bit to see what I can dig up.

  8. Huge says:

    Hi Simon,
    I have had reports that version of gcc later than I have been using have “optimized” the cross-inclusion of headers, meaning they need to be explicitly included. I actually got a patch today, so I’ll merge it in soon. But you are on the right track!

    Hugh

  9. I got it to build correctly, but it crashes on opening now. This was the issue I found with the errors about the architecture http://stackoverflow.com/questions/1456185/build-error-missing-required-architecture-i386-in-file

    I will try and work out why it crashes now!

  10. I’m using iPhone simulator for this (Version 3.x.x – they all do the same, I don’t have access to version 2.x.x)… I put a breakpoint on the __hxcpp_lib_main(); in main.cpp, which just coughs this back

    Current language: auto; currently c++
    Program received signal: “EXC_BAD_ACCESS”.
    Cannot access memory at address 0×1
    Cannot access memory at address 0×1

    Which doesn’t reveal much for me…

  11. Huge says:

    Hi Simon,
    The most helpful bit will be the call stack.
    It may be crashing before the lib_main gets called. In the debugger-console-window, you can type “where” to get the list.
    I use the simulator/sdk version 3.0.0.

    Hugh

  12. This is the stack when I type “where” in the console.

    #0 SDL_main (argc=1, argv=0x130f030) at /Users/simon/Documents/workspace/haxe/Haxe Test/main.cpp:21
    #1 0x0009fb41 in -[SDLUIKitDelegate applicationDidFinishLaunching:] ()
    #2 0x308f8ac3 in -[UIApplication _performInitializationWithURL:sourceBundleID:] ()
    #3 0x30901bf5 in -[UIApplication _runWithURL:sourceBundleID:] ()
    #4 0x308fef33 in -[UIApplication handleEvent:withNewEvent:] ()
    #5 0x308fad82 in -[UIApplication sendEvent:] ()
    #6 0x309013e1 in _UIApplicationHandleEvent ()
    #7 0×32046375 in PurpleEventCallback ()
    #8 0×30245560 in CFRunLoopRunSpecific ()
    #9 0×30244628 in CFRunLoopRunInMode ()
    #10 0x308f930d in -[UIApplication _run] ()
    #11 0x309021ee in UIApplicationMain ()
    #12 0x0009f9c1 in main ()
    Current language: auto; currently c++

  13. Huge says:

    Hi,
    Do you have the latest version of sdl-static from svn? You can get them from:
    http://code.google.com/p/sdl-static

    svn checkout http://sdl-static.googlecode.com/svn/trunk/ sdl-static

    You may also need the latest NME libraries from:
    http://code.google.com/p/nekonme/source/checkout

    This may seem painful, but you are almost there…

    Hugh

  14. I have sdl-static, but unsure how to compile it? I guess I’m using make?

    Also this is more of the stack, I removed the break point to see where it actually fell over! http://pastebin.com/m7cc31a1a

  15. Huge says:

    You should just be able to use the libraries in the lib/iphone directory.

    Hugh

  16. Cheers Hugh, this worked now. I had to get nme, hxcpp and sdl-static, once I got all those it worked a treat. Now to try and get UIView on top of it ;-)

  17. Idealprod says:

    Hi again !

    It works great, but I have a few question.
    Is the whole flash API is handled ?
    Can I use libs for flash, like TweenerHX (doesn’t seem to work yet) ?
    Can I use the iPhone api, to handle the inclinometer, the accelerometer, compas, localisation… ?
    Can I make applications built for OS 3.0 working on a ipod on OS 3.1.2 ?

    Thanks !

  18. Huge says:

    Hi,
    Good to see you got it working. in Answer to your questions:
    Is the whole flash API is handled ?
    No – I have only targeted those functions I thought would be needed to get a game off the ground.

    Can I use libs for flash, like TweenerHX (doesn’t seem to work yet) ?
    If you have haxe source code, then you should have a chance. Neko does not support runtime properties, although the latest hxcpp does. This means on neko you can’t do: obj.x=20, you have to do obj.SetX(20).

    Can I use the iPhone api, to handle the inclinometer, the accelerometer, compas, localisation… ?
    The accellerometer is provided by the nme.Joystick class. The axes are the acceleration (usually gravity) resolved in the devices x,y,z directions. A have not done other APIs yet, although in the re-working I’m doing, I will probably add as many of these as I can.

    Can I make applications built for OS 3.0 working on a ipod on OS 3.1.2 ?
    Yes – I’m pretty sure that is how it’s done.

    Hugh

  19. Idealprod says:

    Thanks for that answers !

    I actually have problem to have TweenerHX work, maybe I should rewrite it a bit…

    Do you have a website like the haxe.org/api where I can found which flash9 classes are handled ? It would be great.

    Is there a way I can port, or convert some classes I’m using in my haXe flash program so they work in haXe/iPhone ? For instance, I’m using flash.xml.XMLDocument, and it just can’t find it…

    Thanks.

  20. Idealprod says:

    Hum… When I use gdb on iPhone device (real) i get many error messages which says “Bad font ; ARIAL.TTF”… How can I fix that ?

  21. Idealprod says:

    Fixed.
    I have included ARIAL.TTF in my XCode project.

    Could you answer my old post questions ?

  22. Huge says:

    Hi Idealprod,
    There is some code in NME that tries to locate the font on the system. It does

    if strcasecmp(inName.c_str(),”arial.ttf”))
    outFile = FONT_BASE “Arial.ttf”;

    Where FONT_BASE is “/System/Library/Fonts/Cache/” for the iphone (different for the simulator). Maybe this assumption is wrong?

    Also, you should not try to create a text field (eg, in a static initializer) before the call nme.Lib.Init, since the fonts will not have been initialized.

    If you have included the font in your project, you could try “./ARIAL.TTF” to force it to use the local font. If you do not set the font explicitly, you could try neash.text.TextField.mDefaultFont = “./ARIAL.TTF”.

    As for flash.XML, you have to use the haxe “Xml” class if you want to be cross-platform.

    Hope this helps,

    Hugh

  23. fluxa says:

    Hi, thanks! it works great but I have a couple of questions.

    I’ve been trying to load assets from external files:

    First, when I tried to load a PNG using:

    bitmap = new Bitmap(nme.display.BitmapData.Load(“myimage.png”));

    On the iPhone console I got an error:

    pnglib – CgBI: unknown critical chunk

    I fixed that adding a user defined setting in the project configuration, like this:

    User-Defined:
    IPHONE_OPTIMIZE_OPTIONS | -skip-PNGs

    now I’d like to embed or load a SWF file, create an instance and add it to the stage, is it possible?

    I tried:

    var data = new flash.utils.IDataInput(neko.io.File.read(“sweetswf.swf”,true));
    var swf = new neash.swf.SWF(data);

    but I’m getting this error:

    Error ZLib Error : -5

    and the app crashes.

    Has anyone successfully done this?

    Thanks!!

  24. fluxa says:

    Hi again,

    I have this simple example where I’m loading a png using the Loader class, add it to the stage with a enter frame listener which moves the displayobject around the stage.

    I’ve noticed if I make a mouse event (any, i.e: touch the screen) all the moving objects on the stage get distorted.

    some screenshots here: http://tinyurl.com/y9jfyhf

    I’m not sure but I think this is related with the GetObject method called in the DisplayObject class (neash.display.DisplayObject).

  25. Huge says:

    Hi fluxa,
    I’m wondering if it is also a project setting and the swf file is getting somehow translated when it is placed on the device. Does the file run Ok from the desktop version of the code? I was also thinking that I have not thoroughly tested the swf code on the hxcpp target, mainly the neko target, so there may be an issue in the gzip code.

    Your error with the images looks like the selection code (which does something quite similar to rendering) interfering with the render cache.

    I’m currently working hard on a re-write of the nme code, but I will have a look at the swf/gzip code because that will be the same in the new version. The selection however will be a bit different, so I don’t want to spend too much time on it. If you can send me a little bit of source code, I’ll see if there is anything dumb I’m doing there. You can email me at “huge” at this site.

  26. scorpion says:

    Could someone tell me what I might have done wrong? HaxeTest was buil, but linking with c++ gives this error.
    Thanks

    Undefined symbols:
    “_start_thread”, referenced from:
    thread_create(_value*, _value*)in libstd.iphonesim.a(Thread.o)
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    “_start_thread”, referenced from:
    thread_create(_value*, _value*)in libstd.iphonesim.a(Thread.o)
    ld: symbol(s) not found
    collect2: ld returned 1 exit status
    Build failed (1 error)

  27. Hello Huge,

    I’ve recently got to this post, and started following the instructions right away. Unfortunately I didn’t manage to build properly.

    It took a bit of time, but I’ve read all the comments in this post.

    I had one of the errors(#include , which I changed to #include ), but I am stuck pretty at step 12, running the shell script.

    My original error log is posted here: http://pastebin.com/MyeMH7Sv.
    Then I finished reading all the posts and updated(well, reinstalled) haxe, as I had an older version.

    Here is my current setup:

    OSX 10.5.8, Simulator IPhoneOS 2.2.1, haXe Compiler 2.05(used to be Haxe Compiler 2.02),
    hxcpp 2,05,1 – neash 1,0,3 – nme 1,0,2 and I’ve exported the sdl off svn (revision 31) and linked the *.a files inside lib/iPhone

    with this updated setup I get different errors, all posted here: http://pastebin.com/MyeMH7Sv

    I tried with both if ["$CURRENT_ARCH"="i386"] and if ["$CURRENT_ARCH"=="i386"] and didn’t make much difference, then I added tabs to like this if [ "$CURRENT_ARCH"="i386" ]
    and got read of that, and figured out that spaces/tabs do matter, if is matched by fi, enclosing then and else, I think.

    I have no prior experience with bash, c++, just some actionscript 3.

    After the target script(CompileHaxe) got fixed, everything seemed to run (fan went crazy on the macbook for a bit), got some warning, the file got compiled, but it won’t run in the simulator(#
    [Session started at 2010-04-01 01:27:52 +0100.]
    #
    Failed to launch simulated application: Unknown error.).

    Here is the latest log: http://pastebin.com/n9Dm2YiK

    Where am I going wrong ?

  28. I tried to clean all targets, remove frameworks, libraries, etc and star all over again.

    Now I get 41 errors, listed here: http://pastebin.com/vvvt4S6E

    Running out of options.

  29. willva says:

    =) i can’t understand most of the things your saying but if your working on getting .swf and flash files and code to run on an iphone goodluck =) that would be wonderful

  30. Huge says:

    Hi scorpion,
    I think you may have an old version of HXCPP, since the thread stuff has been moved from libstd.iphonesim.a. If you have the latest version, you may need to check that your project refers to the correct libraries.

    Hugh

  31. Huge says:

    Hi George,
    It looks like you are missing the “HaxeTest.iphonesim.a” and the “HaxeTest.iphoneos.a” library files in your project. These should have been generated in when you ran the haxe compiler. ie, Check step 12.

    Hugh

  32. Thanks Huge,

    I’m all set now, I’ve just dragged the generated .a files(HaxeTest.iphonesim.a and HaxeTest.iphoneos.a) to the main project and recompiled, all good.

    Whenever I need to update, I wipe HaxeTest.iphonesim.a and compile twice(the first time the .a file gets generated again, but for some isn’t ready at the right time probably, because the app crashes in the simulator, the second time I compile, it’s all good)

    Thanks again!

  33. Amayzing work man! That’s incredible.

    I’ve had some issues:
    http://ramonfritsch.com/haxe_iphone_issues.png

    please, help me..

    cheers

  34. Timo says:

    Hi Hugh!

    Thanks for the great work! I just got my first hxcpp project up and running on the iPhone.

    I’m now trying to load assets from a resource SWF into my application. (Or even an SWF itself, for starters.)

    I have googled all over the place and reread all the hxcpp and iPhone tutorials. I’ve tried everything I have encountered, but to no avail. Fluxa’s post didn’t work for me either.

    How can I load a MovieClip asset from a resource SWF into my application?

    Any pointers are greatly appreciated!

    Cheers,
    Timo

  35. Timo says:

    Hey Ramon,

    This looks familiar. Did you change…

    #include

    to

    #include

    …as Hugh mentioned above?

    Cheers,
    Timo

  36. All right, I think Hugh could make some updates to this post to share with us all things that you helped here on the comments. I think just the post don’t explain everything by itself to make it work.

    Now I’ve got 120 errors when link, I’ve got all latest libraries versions and I am using 3.1.3 sdk/simulator.

    cheers!

  37. Theorian says:

    it appears that the Error ZLib Error : -5 has something to do with how the swf has been compiled. Do you have any ideas? the Circle1.swf loads fine on to device and Sim but not some other SWFs I’ve tried.

  38. George Corney says:

    Hello, if any of you are like me and have just downloaded the new iOS 4 SDK and you can’t get this to go then after much trial and error the easiest method seems to be to use previous version – it seems as Hugh mentioned earlier that the gcc has been ‘optimised’ and will struggle to produce an iphoneos.a library. (At least I couldn’t get it it go anyway)

    here’s a link to iPhone SDK 3.2 Final with Xcode 3.2.2
    http://developer.apple.com/iphone/download.action?path=/iphone/iphone_sdk_3.2__final/xcode_3.2.2_and_iphone_sdk_3.2_final.dmg

    there’s more here:
    http://iphonesdkdev.blogspot.com/2010/04/old-versions-of-iphone-sdk.html

    don’t forget to edit BuildCommon.xml in /usr/lib/haxe/lib/hxcpp/2.05.x/build-tool and change IPHONE_VER to match the 3.0 SDK, tho if you’re upgrading you’ll probably still the 2.2.1 in there too!

    Good luck!

  39. Alec says:

    hey, i think I got everything working, but it appears that hxcpp and cohorts don’t support iOS 4.0. Perhaps a recompile is in order? I get these errors:

    http://gist.github.com/523976

  40. Huge says:

    Hi Alec,
    The nme version 2 stuff does not use SDL, so these errors should go away. I probably do need to recompile with the latest SDK though.

    Hugh

  41. Frank says:

    Hi, this sounds like something nice to explore. But I get stuck at step 5.. I can’t seem to add “main.cpp” because I can’t find it in the NME project. I installed hxcpp and nme and neash with haxelib. What am I doing wrong, please ?

  42. Huge says:

    Hi Frank,
    Check out the later post, http://gamehaxe.com/2010/08/19/new-release/
    There is an XCode template that should make things much easier.

    Hugh

  43. I know that this post is a bit old but I just found it. There is so much to learn and technology keeps changing so fast. I have a lot of catching up to do. Thank you for a great resource.

  44. I am trying to find a “work around” for the SDL library….not a big fan.

  45. Huge says:

    Hi,
    On iphone and android, SDL is not used. There is some code so you can use windows without SDL. In fact, you can use the “external stage” to use the library without SDL – eg inside wxwindows. So if you are keen, it is pretty easy to side-step SDL.

  46. John Winthrop says:

    So when I get out of the car and walk around it, what gear should I leave it in, and should the car be turned on when I do so?

  47. leo says:

    hey guys.
    I got a problem.My nme’s version is 3.4.4 , I can’t find Main.cpp under the folder that Huge mentioned in the fifth entry.Where can i get it.Who could send me a copy of it.Thanks .
    This is my email: qiao.jia@playfish.com

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>