我想创建一个使用c的ruby扩展,但是当我用gcc编译它时,我得到了一个错误:
gcc rubyext.c -orubyext -I /usr/local/include/ruby-1.9.1/
In file included from rubyext.c:1:
/usr/local/include/ruby-1.9.1/ruby/ruby.h:25:25: error: ruby/config.h: No such file or directory
In file included from rubyext.c:1:
/usr/local/include/ruby-1.9.1/ruby/ruby.h:107: error: âSIZEOF_INTâ undeclared here (not in a function)
/usr/local/include/ruby-1.9.1/ruby/ruby.h:108: error: âSIZEOF_LONGâ undeclared here (not in a function)
/usr/local/include/ruby-1.9.1/ruby/ruby.h:112: error: âSIZEOF_VOIDPâ undeclared here (not in a function)
In file included from /usr/local/include/ruby-1.9.1/ruby/ruby.h:1326,
from rubyext.c:1:
/usr/local/include/ruby-1.9.1/ruby/missing.h:25: error: redefinition of âstruct timevalâ
/usr/local/include/ruby-1.9.1/ruby/missing.h:35: error: redefinition of âstruct timespecâ
In file included from /usr/local/include/ruby-1.9.1/ruby/intern.h:27,
from /usr/local/include/ruby-1.9.1/ruby/ruby.h:1327,
from rubyext.c:1:
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/include/varargs.h:4:2: error: #error "GCC no longer implements <varargs.h>."
/usr/lib/gcc/x86_64-linux-gnu/4.4.3/include/varargs.h:5:2: error: #error "Revise your code to use <stdarg.h>."
In file included from /usr/local/include/ruby-1.9.1/ruby/intern.h:29,
from /usr/local/include/ruby-1.9.1/ruby/ruby.h:1327,
from rubyext.c:1:
/usr/local/include/ruby-1.9.1/ruby/st.h:122: error: expected declaration specifiers or â...â before âuint32_tâ
In file included from /usr/local/include/ruby-1.9.1/ruby/ruby.h:1327,
from rubyext.c:1:
/usr/local/include/ruby-1.9.1/ruby/intern.h:508: error: expected declaration specifiers or â...â before ârb_pid_tâ
/usr/local/include/ruby-1.9.1/ruby/intern.h:526: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before ârb_forkâ
/usr/local/include/ruby-1.9.1/ruby/intern.h:527: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before ârb_fork_errâ
/usr/local/include/ruby-1.9.1/ruby/intern.h:529: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before ârb_waitpidâ
/usr/local/include/ruby-1.9.1/ruby/intern.h:530: error: expected â)â before âpidâ
/usr/local/include/ruby-1.9.1/ruby/intern.h:531: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before ârb_spawnâ
/usr/local/include/ruby-1.9.1/ruby/intern.h:532: error: expected â=â, â,â, â;â, âasmâ or â__attribute__â before ârb_spawn_errâ
/usr/local/include/ruby-1.9.1/ruby/intern.h:534: error: expected â)â before âpidâ
/usr/local/include/ruby-1.9.1/ruby/intern.h:652: error: expected declaration specifiers or â...â before âuint32_tâ
#include <ruby.h>
任何帮助都非常感谢。