Questions tagged [libffi]

libffi is a portable Foreign Function Interface library, used to call functions defined in a different programming language

libffi defines a C API for calling functions defined in different languages with different calling conventions. It is commonly used to provide a bridge between compiled languages and interpreted languages.

See the project homepage or the Wikipedia page for more information.

84 questions
39
votes
4 answers

Error installing bcrypt with pip on OS X: can't find ffi.h (libffi is installed)

I'm getting this error when trying to install bcrypt with pip. I have libffi installed in a couple places (the Xcode OS X SDK, and from homebrew), but I don't know how to tell pip to look for it. Any suggestions? Downloading/unpacking bcrypt==1.0.2…
Cody
  • 2,467
  • 2
  • 21
  • 30
22
votes
6 answers

package configuration for libffi is not found in macOS while installing travis-cli

I am trying to install gem install travis to use travis-cli as per reference https://rubygems.org/gems/travis but getting below error. Tried solution mentioned here https://github.com/ffi/ffi/issues/653 : brew reinstall libffi export…
Avinash Dalvi
  • 8,551
  • 7
  • 27
  • 53
20
votes
4 answers

In C, given a variable list of arguments, how to build a function call using them?

Suppose there's a list of arguments stored somehow, in a array for example. Given a function pointer, how could I make a call to it passing the stored list of arguments? I'm not trying to pass the array as an argument ok. You got it, ok? I want to…
oblitum
  • 11,380
  • 6
  • 54
  • 120
17
votes
11 answers

Error installing CocoaPods - macOS BigSur

I'm learning how to program, and I am trying to install Cocoapods, but I'm getting an error with sudo gem install cocoapods. This is what I get: Building native extensions. This could take a while... ERROR: Error installing cocoapods: …
Max Sanchez
  • 301
  • 1
  • 2
  • 9
15
votes
3 answers

How to install libffi-dev on Mac OS X

I am trying to implement micropython on unix, which requires libffi-dev. I installed in this way brew install libffi-dev. But it seems that there is no libffi-dev can be found. Is there any way to install libffi-dev on Mac os. Thank you.
Xiufen Xu
  • 463
  • 3
  • 6
  • 11
10
votes
1 answer

Compiling libffi with VS2012 fails with fatal error LNK1281: Unable to generate SAFESEH image

Compiling libffi with VS11 gives the following linker error libffi\libffi-3.0.9\ms\Win32\Debug\ffi.dll : fatal error LNK1281: Unable to generate SAFESEH image. The same project was compiling fine with VS10, but after an auto upgrade with VS2012, it…
Abhijit
  • 62,056
  • 18
  • 131
  • 204
8
votes
3 answers

Build error: "Unknown type name 'ffi_cif'"

When building my XCode project, for one of my cocoapod dependencies, libffi, I get 5 build errors, all along the lines of /Pods/libffi/ios/include/ffi_common.h:77:1: Unknown type name 'ffi_status' Any ideas what I could try to debug it? I've already…
meisel
  • 2,151
  • 2
  • 21
  • 38
7
votes
6 answers

Haskell binding with Ruby through FFI?

Since both ruby and Haskell supports FFI, Is it possible to call Haskell code from ruby, may be through FFI ? Is there any Haskell binding in Ruby ?
taylor luk
6
votes
8 answers

How can I write a generic C function for calling a Win32 function?

To allow access to the Win32 API from a scripting language (written in C), I would like to write a function such as the following: void Call(LPCSTR DllName, LPCSTR FunctionName, LPSTR ReturnValue, USHORT ArgumentCount, LPSTR Arguments[]) which…
Matthew Murdoch
  • 30,874
  • 30
  • 96
  • 127
6
votes
1 answer

Variadic templates: iterate over type/template argument

I've been working with libffi lately, and since it uses a C API, any abstraction is done by using void pointers (good ol' C). I'm creating a class (with variadic templates) which utilizes this API. The class declaration is the following: (where Ret…
Elliott Darfink
  • 1,153
  • 14
  • 34
5
votes
1 answer

Trouble with installing libffi-dev for Python 3.7

When trying to install pgadmin4 in desktop mode on my Ubuntu system, I received a ModuleNotFoundError for _ctypes. I did some research and found that _ctypes requires the libffi-dev package to be installed. However it seems that libffi-dev and thus…
Kevin Vuong
  • 51
  • 1
  • 2
  • 4
5
votes
1 answer

How to install libffi-dev and libssl-dev on Windows

I am trying to run a piece of code using paramiko, but I get the error message ImportError: No module named cryptography.hazmat.backends. Both paramiko and cryptography are already installed. As far as I can read on various forums, I need to…
A. A. Pedersen
  • 161
  • 1
  • 1
  • 8
5
votes
1 answer

OSX stat() and libffi

I'm trying to access stat() on macos (10.11) using libffi. This is part of a new FFI-based foreign interface for SWI-Prolog. This interface parses the header to get the function prototype and struct stat type. However, I get bogus…
Jan Wielemaker
  • 1,670
  • 10
  • 18
5
votes
1 answer

Custom X86_64 calling convention to C function call

I've to do an interface (say, a wrapper) that allow a call from X86_64 assembly code using his calling convention to C function, with other calling convention. The best thing would be to be pretty "compiler independant" (juste modifying the…
Matthieu
  • 53
  • 1
  • 3
5
votes
3 answers

Passing structs by value with cffi-libffi?

I'm under the impression that CFFI cant pass structs by value, but the CFFI documentation says: To pass or return a structure by value to a function, load the cffi-libffi system and specify the structure as (:struct structure-name). To pass or…
user2735131
1
2 3 4 5 6