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

I want to use it in iOS or Android but I can't compile #479

Closed
veryitman opened this issue Mar 10, 2019 · 7 comments
Closed

I want to use it in iOS or Android but I can't compile #479

veryitman opened this issue Mar 10, 2019 · 7 comments

Comments

@veryitman
Copy link

veryitman commented Mar 10, 2019

I want to use it in iOS or Android but I can't compile,please give a tip, thanks.

I have compile it, and generate libjson-c.a, libjson-c.4.dylib and ect,but it can't run iOS or macOS(10.14+).

file was built for archive which is not the architecture being linked (x86_64): /Users/man/workspace/libjson-c.a Undefined symbols for architecture x86_64: "_json_object_from_file", referenced from:

@hawicz
Copy link
Member

hawicz commented Mar 11, 2019

Can you compile, or can't you?
Are you trying to run on iOS? Or Android? Or macOS?
It sounds like you're pretty confused as to what you're trying to do, and until you sort that out you're going to have a hard time getting help from anyone.

btw, building on macOS (using the standard instructions) or Android (using the instructions in Android.configure.mk), should work fine, though I personally haven't tried either.
I've not heard of anyone trying to build on iOS. That's not to say it doesn't work, but you might be on your own there.

@hawicz hawicz closed this as completed Mar 11, 2019
@veryitman
Copy link
Author

image
This is the result file.
I want to add 'libjson-c.a' into project for iOS project, but the project compile error as follow

file was built for archive which is not the architecture being linked (x86_64): /Users/man/workspace/libjson-c.a Undefined symbols for architecture x86_64: "_json_object_from_file", referenced from:

Now I use json-c with source and add to xcode for ios, It's ok.

How to do when I want to use 'libjson-c.a'?

@veryitman
Copy link
Author

And use your way what compile the json-c, it supports x86_64 only.
image

@ploxiln
Copy link
Contributor

ploxiln commented Mar 11, 2019

If you want to link and run on an ARM iOS device, you need to use the iOS cross-compiling toolchain, which is included in Xcode somehow. This is a complicated topic which is not really the responsibility of libevent.

@veryitman
Copy link
Author

@ploxiln
I write a shell file that is a cross-compilation, it generate a libjson-c.a for x86_64 but it happends error allways.

Can you understand what I say?

@ploxiln
Copy link
Contributor

ploxiln commented Mar 15, 2019

x86_64 is the architecture of your macOS laptop, but not of your iOS phone/tablet, so it doesn't work for iOS phone/tablet

@veryitman
Copy link
Author

I get you. But even you run make and make install to compile the source, it doesn't support macos' project that happends error. In words, I can't use the *.a file at macos or iOS etc.

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

3 participants