No such file or directory "ruby/config.h" when trying to compile C++ into Ruby using SWIG -
i'm trying basic example running using swig convert c++ file ruby. have ruby 2.0.0p451 (64 bit version) installed , i've installed 64-bit devkit. i'm running windows 7 , trying use swigwin-2.0.12. finally, using gcc c++ compiler supplied mingw-builds 64-bit version of windows.
i have basic c++ hello world program shown below.
#include <iostream> #include <cstdlib> using namespace std; main() { cout << "hello world!"; system("pause"); return 0; } at command prompt, use command:
swig -module -c++ -ruby hello_world.cpp this completes fine , produces file titled hello_world_wrap.cxx. however, when receive error when try compile .cxx file using command:
g++ -fpic -c hello_world_wrap.cxx -ic:\ruby200-x64\include\ruby-2.0.0 the error receiving is:

all research i've done has pointed me installation of incorrect devkit, don't think issue. i've made sure download 64-bit version of ruby , devkit. i've checked folder specified in error, , there no config.h file. i'm not sure why config.h file not exist or why ruby.h trying load it.
any thoughts?
check c:\ruby200-x64\include\ruby-2.0.0\ruby\config.h exists. if not, find , fix path.
update:
check if there ruby.h in same folder. if there use -ic:\ruby200-x64\include\ruby-2.0.0\ruby\x64-mingw instead. otherwise try adding second -i, path. agree little strange (not former, if have have 2 -i). script @ https://groups.google.com/forum/m/#!topic/comp.lang.ruby/rpjuvxpfi30 suggests might normal, i.e. need 1 -i platform-independent headers , 1 platform-dependent.
Comments
Post a Comment