We used the Zlib.cpp from HXCPP on our legacy code, but newer HXCPP versions may affect how this works. It looks like it is looking for a system library.
Perhaps there’s a framework you can manually add in Xcode that might add zlib? (libz)
Well, I’m using an older hxcpp version (3.4.64), which has worked for me before, and has the Zlib.cpp file.
I’m not sure how I would add a framework, doesn’t the lime build need to complete in order to have a working Xcode project from where I can add frameworks? Sorry if this is basic, I’m not that experienced working with Xcode/macOS.
I think this would be in Xcode, when building the application. Pretend that lime.a is already good, perhaps there is a way to update your application Xcode project to include the framework. Otherwise, it may be necessary to rebuild Lime using a newer iOS SDK?
I tried adding libz.tbd to the frameworks in Xcode (which it finds by searching in “Link Binary With Libraries”), but the exact same error appears when I try to build. Is there a way to know where it’s looking for the file so I could maybe copy it there?
Regarding rebuilding Lime with a newer SDK, I’m not sure how I would do that, is the SDK I have automatically used when rebuilding Lime?
When trying to build the game there was an error due to incompatible Lime and HaxeFlixel versions, although if I understood correctly the dev version should be using the version of Lime I was using? I “fixed” this by just commenting the line in FlxDefines.hx that was checking the Lime version, and was able to complete the build.
Then when I compile and try to run in the simulator, it always fails to run the game somehow (either “unable to attach to pid …”, “connection timed out”, “DTServiceHubClient failed to bless service hub for simulator …”, or it installs and tries to open the app, but doesn’t go beyond a black screen).
When it tries to run the app, the following appears in the Xcode output window:
Primitive not found : lime_legacy_byte_array_init__4 Error Null Function Pointer
So then I tried recompiling Lime with the -Dlegacy option, i.e. lime rebuild ios -Dlegacy, but the result seems the same (lime_legacy_byte_array_init__4 is still not found after building and running the game).
Lime hasn’t had a “legacy” code path for years, but there should still be a “legacy” branch on our GIT repository, which you could try with OpenFL 3.6.1, then yes, try lime rebuild ios -Dlegacy
Sorry, but I’m not sure if I’m doing this right.
I tried the command git checkout origin/legacy, which showed the following:
warning: unable to rmdir project/lib/axtls: Directory not empty
warning: unable to rmdir project/lib/efsw: Directory not empty
warning: unable to rmdir project/lib/mbedtls: Directory not empty
warning: unable to rmdir project/lib/tinyfiledialogs: Directory not empty
warning: unable to rmdir project/lib/vpx: Directory not empty
warning: unable to rmdir project/lib/webm: Directory not empty
M project/lib/cairo
M project/lib/curl
M project/lib/freetype
M project/lib/harfbuzz
M project/lib/openal
M project/lib/sdl
Note: checking out 'origin/legacy'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
HEAD is now at b19a70e8... Update System.mm
But then when I try to rebuild lime it shows: Error: Could not find include file "lib/nfd/files.xml"
I tried it, rebuilt lime (lime rebuild ios -Dlegacy) and now when I try to build the project (lime build ios) the following error appears:
Called from ? line 1
Called from CommandLineTools.hx line 1400
Called from CommandLineTools.hx line 25
Called from a C function
Called from CommandLineTools.hx line 126
Called from CommandLineTools.hx line 619
Called from lime/project/PlatformTarget.hx line 70
Called from lime/tools/platforms/IOSPlatform.hx line 369
Called from lime/project/HXProject.hx line 244
Called from lime/project/ConfigData.hx line 35
Called from lime/tools/helpers/ObjectHelper.hx line 127
Called from lime/tools/helpers/ObjectHelper.hx line 127
Called from lime/tools/helpers/ObjectHelper.hx line 127
Called from lime/tools/helpers/ObjectHelper.hx line 76
Called from /usr/local/lib/haxe/std/neko/_std/Array.hx line 118
Uncaught exception - Invalid operation (+)
Still doesn’t work, now when I try to build the game the following appears:
/Applications/Xcode.app/Contents/Developer/usr/bin/make
Haxe device build: Release-iphoneos-v7
haxe Build.hxml -D HXCPP_ARMV7 -cpp build/Release-iphoneos-v7
cd build/Release-iphoneos-v7; export HXCPP_NO_COLOR=1; haxelib run hxcpp Build.xml -Dios -Diphone -DHXCPP_ARMV7 -DHXCPP_CPP11 -DHXCPP_CLANG -DOBJC_ARC `cat Options.txt | while read LINE; do printf " -D$LINE"; done`
Error: This is the first time you are runing haxelib. Please run `haxelib setup` first
make: *** [build-haxe-armv7] Error 1
Command /Applications/Xcode.app/Contents/Developer/usr/bin/make failed with exit code 2
I tried running haxelib setup as the error suggests, but nothing changes.
hxcpp (Haxe C++ Runtime Support) (3.4.64)
Usage:
haxelib run hxcpp file.xml [options]
Build project from "file.xml". options:
-Dvalue -- Specify a define to use when processing other commands
-verbose -- Print additional information (when available)
haxelib run hxcpp file.cppia
Run cppia script using default Cppia host
haxelib run hxcpp file.js
Run emscripten compiled scipt "file.js"
haxelib run hxcpp cache [command] [project]
Perform command on cache, either on specific project or all. commands:
clear -- remove all files from cache
days #days -- remove files older than "days"
resize #megabytes -- Only keep #megabytes MB
list -- list cache usage
details -- list cache usage, per file
Although I’m not sure if you meant that I should build lime this way with include.xml or haxelib.xml?
Ah, I should have remembered to try with sudo. It worked! The game finally runs in the simulator. Thank you, I really appreciate the help! I’ll finally be able to publish my game on the app store