相关疑难解决方法(0)

mkmf在编译C扩展名时会忽略子文件夹中的文件

我想这样组织C源代码:

+ /
|
|___ + ext
|    |
|    |___ + native_extension
|         |
|         |___ + lib
|         |    |
|         |    |___ (Source files are kept in here - may contain sub-folders)
|         |
|         |___ native_extension.c
|         |___ native_extension.h
|         |___ extconf.rb
|
|___ + lib
|    |
|    |___ (Ruby source code)
|
|___ Rakefile
Run Code Online (Sandbox Code Playgroud)

我无法让此设置正确使用mkmfnative_extension/lib中包含的中的文件native_extension.c,将被完全忽略。

构建扩展时,仅native_extension.{h,c}会进行编译,并且native_extension.{so,dll}在尝试运行扩展程序时出现不完整的符号查找错误。

有什么办法可以使这项工作吗?

c ruby mkmf ruby-c-extension

5
推荐指数
2
解决办法
649
查看次数

标签 统计

c ×1

mkmf ×1

ruby ×1

ruby-c-extension ×1