1

I am trying to use libffi (https://github.com/libffi/libffi) to create functions at runtime in iOS. However, I am not sure on how to import it to Xcode or how to even get started with the library. libffi-iOS project was last updated some 3 years back.

Please can someone help with tutorial or steps or a simple Xcode project that uses libffi etc.

When I try to compile the library, following is the error I get:

"_ffi_call_win64", referenced from:

_ffi_call_int in ffiw64.o

"_ffi_closure_win64", referenced from:

  _ffi_prep_closure_loc_efi64 in ffiw64.o

 (maybe you meant: _ffi_closure_win64_inner)

"_ffi_go_closure_win64", referenced from:

  _ffi_prep_go_closure_efi64 in ffiw64.o

 "ffi_closure_win64_inner", referenced from:

  ffi_closure_win64 in win64.o

 (maybe you meant: _ffi_closure_win64_inner)

 ld: symbol(s) not found for architecture x86_64

 clang: error: linker command failed with exit code 1 (use -v to see invocation)

 make[2]: *** [libffi.la] Error 1

 make[1]: *** [install-recursive] Error 1

 make: *** [install] Error 2
prabodhprakash
  • 3,825
  • 24
  • 48
  • may be it will help you http://stackoverflow.com/questions/32156260/how-do-i-compile-libffi-for-ios-os-x –  May 19 '16 at 05:30
  • I have tried this - updated question with the error that I get. However, even post that I am not sure, what next to do. – prabodhprakash May 19 '16 at 05:39

1 Answers1

0

There's a PR for libffi that fixes up the iOS build. I don't know when exactly it will be merged, but you could help move things along by trying it out and reporting back in the PR.

Tom Tromey
  • 21,507
  • 2
  • 45
  • 63