Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hxcpp libz linking problems #313

Closed
ghost opened this issue Oct 14, 2015 · 4 comments
Closed

hxcpp libz linking problems #313

ghost opened this issue Oct 14, 2015 · 4 comments

Comments

@ghost
Copy link

ghost commented Oct 14, 2015

I'm trying to use haxe-created static library in our cross-platform game engine. I compiled the lib for both ios and android but have several issues when linking it. As the haxe-created lib requires it's own libz, std and regex, I link them to my ios project. My project also uses libz (from iPhoneIos sdk) so I get conflicts in runtime - libpng presumably refers the libz stuff from haxe's libz and it leads to bugs. Ok, on ios this can be fixed by changing the linking order in Xcode (system libz must be linked first) but it seems to be a very insecure solution.

On android I just get many "multiple definition of ..." for symbols defined both in system's libz and haxe's libz.
How should I link it all together)?

I use -D static_link in my target's hxml.
MacOS 10.11, hxcpp 3,2,180, Haxe Compiler 3.2.0, NekoVM 2.0.0

@thomasuster
Copy link
Contributor

Do you ever get an android error that says has unexpected e_machine: 3?

@ghost
Copy link
Author

ghost commented Oct 14, 2015

No, just linker's multiple definition errors

@hughsando
Copy link
Member

I have added an optional define, "-D HXCPP_LINK_NO_ZLIB". If you provide this to the haxe command line and import "hxcpp.StaticZlib", you can and must provide your own version of zlib when linking your final application.

@ghost
Copy link
Author

ghost commented Nov 20, 2015

Hi Hugh

Thank you for fixing this, it works for me!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants