You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an FFI project that needs to access an extern variable (not a function), but compilation fails with the following error:
info: bug: no previous manifest, creating one from scratch
ℹ [1/4] Built bug/ffi.o
info: stdout/stderr:
==> Building targer Main.ffi.cpp ...
trace: .> c++ -c -o ././.lake/build/Main.ffi.o ./././Main.ffi.cpp -I /Users/yuri/.elan/toolchains/leanprover--lean4---nightly/include
ℹ [2/4] Built Main
trace: .> LEAN_PATH=././.lake/build/lib DYLD_LIBRARY_PATH=././.lake/build/lib /Users/yuri/.elan/toolchains/leanprover--lean4---nightly/bin/lean ././././Main.lean -R ./././. -o ././.lake/build/lib/Main.olean -i ././.lake/build/lib/Main.ilean -c ././.lake/build/ir/Main.c --json
✖ [3/4] Building Main:c.o (with exports)
trace: .> /Users/yuri/.elan/toolchains/leanprover--lean4---nightly/bin/leanc -c -o ././.lake/build/ir/Main.c.o.export ././.lake/build/ir/Main.c -O3 -DNDEBUG -DLEAN_EXPORTING
info: stderr:
././.lake/build/ir/Main.c:33:25: error: called object type 'uint16_t' (aka 'unsigned short') is not a function or function pointer
x_1 = this_ffi_type_void();
~~~~~~~~~~~~~~~~~~^
././.lake/build/ir/Main.c:109:1: error: use of undeclared identifier 'l_ffi__type__void'
l_ffi__type__void = _init_l_ffi__type__void();
^
././.lake/build/ir/Main.c:109:21: warning: call to undeclared function '_init_l_ffi__type__void'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
l_ffi__type__void = _init_l_ffi__type__void();
^
1 warning and 2 errors generated.
error: external command '/Users/yuri/.elan/toolchains/leanprover--lean4---nightly/bin/leanc' exited with code 1
Some builds logged failures:
- Main:c.o (with exports)
error: build failed
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
I have an FFI project that needs to access an extern variable (not a function), but compilation fails with the following error:
This is the line causing it:
I also tried the following but got the same problem:
Steps to Reproduce
Expected behavior: generated code compiles
Actual behavior: generated code does not compilke
Versions
The text was updated successfully, but these errors were encountered: