Building on Mac

  • Hi, I'm pretty new in Mac development and been looking to port my game over from windows but having some trouble doing so

    I installed the latest haxe and hflx versions but it seems hflx is not compatible with the latest version of haxe on Mac so I decided to downgrade to the version it tells me to, 2.9.1. I uninstalled Haxe by deleting everything on /usr/local/bin/ and /usr/local/lib/. Using the 2.9.1 haxe installer didn't seem to work correctly so I downloaded the 2.9.1 haxe binaries and the latest neko binaries and dropped all that on /usr/local/bin/.

    This allowed me to install openfl and haxeflixel just fine, but when I want to build my project using "lime build mac" I get the message "Standard library not found"

    I can imagine doing something wrong since the whole process felt kind of messy, but would love to hear any ideas

  • Last time I did this it was the same as installing on windows. Did you followed the instructions?

  • @Agustín-Pérez-Fernández Yeah, followed those instructions as my first attempt, just like I did on Windows.

    Apparently something in Haxe 3.2 isn't compatible with Haxeflixel on Mac because it just doesn't let me build

  • Just to be on safe side, did you did lime setup mac?

  • @astorga yup

    Just today I managed to compile and run the helloworld example by:

    • Installing openfl 3.6.1 instead of the latest version
    • After installing flixel setting lime to version 2.9.1

    This worked great on the helloworld project but for my own game I'm now encountering some issues

    Error: While running :xcrun --sdk macosx clang++ -I/zkylon/MyGame/Game/export/mac64/cpp/obj/obj/darwin64/__pch/haxe -Iinclude -c -fvisibility=hidden -stdlib=libstdc++ -Qunused-arguments -O2 -I/usr/local/lib/haxe/lib/hxcpp/3,3,49/include -DHX_MACOS -m64 -Wno-parentheses -Wno-null-dereference -Wno-unused-value -Wno-format-extra-args -Wno-bool-conversion -DHXCPP_M64 -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=321 -x c++ -frtti -Wno-invalid-offsetof ./src/openfl/ui/GameInputDevice.cpp -o/zkylon/MyGame/Game/export/mac64/cpp/obj/obj/darwin64/0df71d88_GameInputDevice.o
    In file included from ./src/openfl/ui/GameInputDevice.cpp:34:
    include/openfl/ui/GameInputDevice.h:58:3: error: use of undeclared identifier 'lime'
                   lime::ui::Gamepad __gamepad;
    include/openfl/ui/GameInputDevice.h:38:3: error: cannot initialize return object of type 'super *' (aka 'hx::Object *') with an rvalue of type 'openfl::ui::GameInputDevice_obj *'
    /usr/local/lib/haxe/lib/hxcpp/3,3,49/include/hx/Macros.h:74:39: note: expanded from macro 'HX_DO_RTTI_ALL'
      inline operator super *() { return this; } 

    It seems to be something gamepad related between lime and openfl since my game doesn't use a gamepad, but since it doesn't happen in the helloworld example it's kind of strange.

    Will keep updating if I make any progress, thanks

    edit: just did a quick test of building on windows, not just neko and seems like the same issue is present in windows.

    I'm using these versions of the libraries, gonna look a bit more at my code but It's a pretty strange error considering I don't use gamepads whatsoever
    alt text

  • I also have issues using Gamepad API.
    You can add <haxedef name="FLX_NO_GAMEPAD" /> on your Project.xml. It might solve your problem.

  • @astorga yeah, i already had that set on my project.xml, but sadly doesn't seem to fix it.

    This is pretty strange since a month ago i was building for Windows just fine.

    I might do a quick revert to see if anything's I've done since is what's triggering this issue

  • Did you updated lime to anything higher than 2.9.1 and/or openfl to anything higher than 3.6.1?

  • @astorga i definitely did in the past since as you can see in the picture above i have lime 3.2.0 and openfl 4.2.0 installed, just not set as active.

    you think i might want to look into doing a clean install?

  • administrators

    Do you have <haxelib name="openfl"> or <haxelib name="lime"> in your Project.xml? If so, remove that - Flixel already includes these for you, including them twice can cause issues.

  • @Gama11 just checked that, not using any of those two.

    I'll just add my project.xml in case you guys see something weird. The only strange thing I think I have is the include macro at the bottom that I use for reflection when I instantiate stuff off names I give objects on the Tiled editor, but I don't think this has caused me issues before

    <?xml version="1.0" encoding="utf-8"?>
    <!------------------------------APPLICATION SETTINGS---------------------------->
    <app title="MyGame" file="MyGame" main="Main" version="0.1.0" company="MyCompany" package="com.mycompany.mygame"/>
    <!--The flixel preloader is not accurate in Chrome. You can use it regularly if you embed the swf into a html file
    <!--or you can set the actual size of your file manually at "FlxPreloaderBase-onUpdate-bytesTotal"!-->
    <app preloader="flixel.system.FlxPreloader" />
    <!--Minimum without FLX_NO_GAMEPAD: 11.8, without FLX_NO_NATIVE_CURSOR: 11.2 -->
    <set name="SWF_VERSION" value="11.8" />
    <!--------------------------------WINDOW SETTINGS------------------------------->
    <!--These window settings apply to all targets-->
    <window width="1280" height="720" fps="60" background="#e2e2e2" hardware="true" vsync="true" antialiasing="4" />
    <window if="web" orientation="portrait" />
    <window if="desktop" orientation="landscape" fullscreen="false" resizable="false" />
    <window if="mobile" orientation="landscape" fullscreen="true" width="0" height="0" /> 
    <!--------------------------------PATHS SETTINGS-------------------------------->
    <set name="BUILD_DIR" value="export" />
    <classpath name="source" />
    <assets path="assets" embed="true" />
    <assets path="user" embed="false"/>
    <!--<set name="next" />-->
    <haxelib name="flixel"/>
    <!--In case you want to use the addons package-->
    <haxelib name="flixel-addons"/>
    <!--In case you want to use the ui package-->
    <!--<haxelib name="flixel-ui"/>-->
    <!-- <haxelib name="svg" /> -->
    <!--In case you want to use nape with flixel-->
    <!--haxelib name="nape" /-->
    <!--Enable the Flixel core recording system-->
    <!--haxedef name="FLX_RECORD" /-->
    <!--Disable the right and middle mouse buttons-->
    <!--haxedef name="FLX_NO_MOUSE_ADVANCED" /-->
    <!--Disable the Native cursor api for Flash target-->
    <!--haxedef name="FLX_NO_NATIVE_CURSOR" /-->
    <!--Optimise inputs, be careful you will get null errors if you don't use conditionals in your game-->
    <haxedef name="FLX_NO_MOUSE" if="mobile" />
    <haxedef name="FLX_NO_KEYBOARD" if="mobile" />
    <haxedef name="FLX_NO_TOUCH" if="desktop" />
    <haxedef name="FLX_NO_GAMEPAD" />
    <!--Disable the Flixel core sound tray-->
    <haxedef name="FLX_NO_SOUND_TRAY" />
    <!--Disable the Flixel sound management code-->
    <!--haxedef name="FLX_NO_SOUND_SYSTEM" /-->
    <!--Disable the Flixel core focus lost screen-->
    <!--haxedef name="FLX_NO_FOCUS_LOST_SCREEN" /-->
    <!--Disable the Flixel core debugger. Automatically gets set whenever you compile in release mode!-->
    <haxedef name="FLX_NO_DEBUG" unless="debug" />
    <!--Enable this for Nape release builds for a serious peformance improvement-->
    <haxedef name="NAPE_RELEASE_BUILD" unless="debug" />
    <haxedef name="no-inline" if="neko"/>
    <haxedef name="dce=full" if="neko"/>
    <!--Place custom nodes like icons here (higher priority to override the HaxeFlixel icon)-->
    <haxedef name="FLX_NO_DEBUG" if="mobile" />
    <icon path="assets/icons/icon.svg"/>
    <icon path="assets/icons/icon-64.PNG" size="64"  />
    <icon path="assets/icons/icon-96.PNG" width="96" height="96"  />
    <icon path="assets/icons/icon-512.PNG" size="512" />
    <android permission="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <haxeflag name="--macro" value="include('gameObjects')" />

  • Just to do some follow-up on this, I finally managed to get my game running on mac with the above setup (openfl 3.6.1 and lime 2.9.1 on a clean install)

    The issue I had above was with some bad imports of "" that I seem to have done by mistake since I never really used it.

    Thanks for all the replies and help

Log in to reply

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.