-
Notifications
You must be signed in to change notification settings - Fork 341
Open
Description
I have the following header file:
const i = 5;The c file which will be compiled to a library:
#include "example.h"In ruby, I have the following:
require 'ffi'
module Example_FFI
extend FFI::Library
ffi_lib "example"
attach_variable :i, :int
endWhen I run the ruby code, I get the following error:
~/.gem/ruby/3.2.2/gems/ffi-1.17.0-x86_64-darwin/lib/ffi/library.rb:286:in `attach_variable': Function 'i' not found in [#<FFI::DynamicLibrary:0x000000010b37df00>] (FFI::NotFoundError)
from ~/Documents/projects/header-bridge/example/exampleLib.rb:12:in `<module:Example_FFI>'
from ~/Documents/projects/header-bridge/example/exampleLib.rb:3:in `<top (required)>'
from example/example.rb:1:in `require_relative'
from example/example.rb:1:in `<main>'
Metadata
Metadata
Assignees
Labels
No labels