【问题标题】:Getting an error while installing FFI Gem - [-Werror,-Wimplicit-function-declaration]安装 FFI Gem 时出错 - [-Werror,-Wimplicit-function-declaration]
【发布时间】:2021-05-21 21:50:32
【问题描述】:

具体来说,错误是这样的:

Function.c:563:9: error: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in
C99 [-Werror,-Wimplicit-function-declaration]
        rb_thread_call_without_gvl(async_cb_wait, &w, async_cb_stop, &w);
        ^
Function.c:563:9: note: did you mean 'rb_thread_call_with_gvl'?
Function.c:102:14: note: 'rb_thread_call_with_gvl' declared here
extern void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
             ^
Function.c:948:17: warning: 'ffi_prep_closure' is deprecated [-Wdeprecated-declarations]
    ffiStatus = ffi_prep_closure(code, &fnInfo->ffi_cif, callback_invoke, closure);
                ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/ffi/ffi.h:350:18: note:
'ffi_prep_closure' has been explicitly marked deprecated here
  __attribute__((deprecated))

我一直在尝试使用 Ruby 2.3.6 安装旧版本的 FFI v'1.9.18'。

【问题讨论】:

    标签: ruby-on-rails ruby rubygems


    【解决方案1】:

    找到解决方案: gem install ffi -v '1.9.18' -- --with-cflags="-Wno-error=implicit-function-declaration"

    从这里得到解决方案:StackOverflow

    【讨论】:

    • 谢谢!我做了bundle config build.ffi '-- --with-cflags="-Wno-error=implicit-function-declaration"',然后成功运行bundle install
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-23
    • 2021-10-06
    • 1970-01-01
    • 2015-12-18
    相关资源
    最近更新 更多