ffi Questions

10

Solved

bundle install Fetching gem metadata from https://rubygems.org/........... Fetching gem metadata from https://rubygems.org/.. Resolving dependencies... Enter your password to install the bundle...
Naamana asked 28/6, 2015 at 13:26

3

Solved

I want to have a Rust library expose a const char * static string to C, to be compatible with an existing interface (specifically librsync). That is, the C header file has extern char const *my_st...
Marysa asked 22/11, 2015 at 0:12

1

I used the bindgen crate to create bindings from Rust to a C library but I get a whole bunch of warnings saying: warning: `extern` block uses type `u128`, which is not FFI-safe = note: 128-bit inte...
Dasie asked 21/8, 2020 at 15:50

4

Solved

I am writing a FFI wrapper for Rust. I have seen usages of both libc::c_char and std::os::raw::c_char. My knowledge of C is very minimal and I wonder if there is any difference. What should I...
Bateau asked 8/6, 2017 at 13:1

13

Running 'pod install' on a M1 MacBook failed for me due to an ffi issue, as described here. I followed some of the workarounds (I guess I tried all of them in various order), but now I get a slight...
Conjugated asked 15/3, 2021 at 19:20

3

Solved

The following code works in Python 2: from ctypes import * ## Setup python file -> c 'FILE *' conversion : class FILE(Structure): pass FILE_P = POINTER(FILE) PyFile_AsFile = pythonapi.PyFile_...
Lianaliane asked 21/4, 2013 at 10:37

4

Solved

I haven't found anything in the standard library about how to make a const &'static CStr. I've tried to make my own macro to convert a &'static str literal to a &'static CStr: macro_rul...
Antoineantoinetta asked 11/10, 2019 at 23:23

0

I have some C source code that I am calling from Haskell using ccall FFI. To make the build process as easy as possible, I'd like to use Cabal to compile the C files, so I've added the sources to t...
Timeous asked 4/12, 2023 at 12:28

2

I'm trying to call C functions from SBCL with its FFI facility. The C functions require buffer of bytes (unsigned char) and process the bytes data. Unfortunately, in most cases the buffer is quite ...
Artiste asked 24/10, 2023 at 7:2

14

I am getting this error in Mac 64 bit and have xcode inatalled on machine. Building native extensions. This could take a while... ERROR: Error installing ffi: ERROR: Failed to build gem native ex...
Hawkeyed asked 11/4, 2011 at 18:49

3

Solved

The docs for slice::from_raw_parts warn the programmer to annotate the slice with the correct lifetime. I assume that, given some lifetime 'a, I can perform this annotation with let myslice: &amp...
Jeopardy asked 23/10, 2015 at 15:2

3

I am building a flutter project and am having an issue integrating the web and mobile code in a single project. I want to use Moor and Moor_FFI in my mobile code, but even though the entry point to...
Genome asked 25/2, 2020 at 3:22

2

Solved

I have a simple electron app, trying to use ffi-napi to call a dll file, but I'm getting an "Error in native callback" when running the electron build. Here is my setup: package.json { &...
Labour asked 8/3, 2023 at 0:2

3

Solved

I'm attempting to write Rust bindings for a C collection library (Judy Arrays [1]) which only provides itself room to store a pointer-width value. My company has a fair amount of existing code whic...
Goggleeyed asked 19/5, 2015 at 15:57

2

On OS X 10.9.5... Gemfile source 'https://rubygems.org' gem 'rails', '4.2.0' gem 'sass-rails', '5.0.4' gem 'uglifier', '2.7.2' gem 'coffee-rails', '4.1.0' gem 'jquery-rails', '4.0.5' gem 'turbol...
Selfhypnosis asked 8/9, 2015 at 20:46

3

Solved

I created a struct with dart:ffi. import 'dart:ffi'; import 'package:ffi/ffi.dart'; class TestStruct extends Struct{ external Pointer<Utf8> strText; @Int32() external int nNum; @Bool(...
Hesler asked 4/4, 2022 at 6:16

4

I'm using 'ffi', '~> 1.9', I'm getting this error when I try to run my rails project rake aborted! LoadError: dlopen(/Users/kanye.west/.rbenv/versions/2.6.9/lib/ruby/gems/2.6.0/gems/ffi-1.9.25/l...
Ribaldry asked 23/8, 2022 at 4:13

2

Solved

According the documentation for std::Vec, calling shrink_to_fit() will cause the Vec's capacity to "drop down as close as possible to the length but the allocator may still inform the vector t...
Kinesthesia asked 24/11, 2022 at 4:54

17

Got the DevKit installed and re-ran the ffi install….got this as an output: C:\Documents and Settings\******>gem install ffi Temporarily enhancing PATH to include DevKit... Building native exte...
Undersell asked 21/10, 2011 at 16:42

3

Solved

I want to call a C++ dynamic library (*.so) from Rust, but I don't want to build it from Rust. Like this, cc::Build::new()     .file("src/foo.cc") .shared_flag(true) .compile("libfoo.so"); In ...
Abhor asked 22/10, 2018 at 6:28

2

Solved

What I am trying to do I have built a Rust interface, with which I want to interact via C (or C# but it does not really matter for the sake of the question). Because it does not seem to be possible...
Fite asked 14/2, 2021 at 15:34

3

I have an issue with my new mac to install a new rails app and I really need to resolve it quickly.I fixed all all problems with gem and bundle update is ok but I can not run rails s. I think it is...
Emergence asked 8/2, 2021 at 15:53

1

Context We have a Flutter application that is fully functional and it's already published to both the PlayStore and the AppStore. We're trying to add a Rust binary to the app so that we can use som...
Gronseth asked 15/2, 2022 at 21:50

1

Solved

Below is a Minimum(?) Reproducible Example of my code. It is a first pass at stress testing / benchmarking the WIP Raku Module Dan::Polars. In Rust, I make a libmre.so with this code 1 use libc::c...
Emilieemiline asked 6/7, 2022 at 10:26

1

Iam trying to load a c++ dll in JS using node-ffi. When the dll does not have any external dependencies, it works fine as expected. But it crashes, when it has any external dependencies. const ffi ...
Kreitman asked 5/11, 2020 at 12:2

© 2022 - 2025 — McMap. All rights reserved.