hi,
how do you set the include file path for your extension? can it be done
using mkmf? right now i’m going #include “…/drp.h” which is kind of
ugly.
thanks,
_c
hi,
how do you set the include file path for your extension? can it be done
using mkmf? right now i’m going #include “…/drp.h” which is kind of
ugly.
thanks,
_c
On Mar 28, 7:49 pm, Christophe M. [email protected] wrote:
hi,
how do you set the include file path for your extension? can it be done
using mkmf? right now i’m going #include “…/drp.h” which is kind of
ugly.
find_header(‘drp.h’, ‘…’)
Regards,
Dan
Daniel B. wrote:
On Mar 28, 7:49 pm, Christophe M. [email protected] wrote:
hi,
how do you set the include file path for your extension? can it be done
using mkmf? right now i’m going #include “…/drp.h” which is kind of
ugly.find_header(‘drp.h’, ‘…’)
Regards,
Dan
thanks but that doesn’t work, i still get errors
Building native extensions. This could take a while…
drp_ext_rule_engine.c:20:17: error: drp.h: No such file or directory
this is what my extconf looks like:
require ‘mkmf’
have_library ‘c’, ‘main’
find_header ‘drp.h’, ‘…’
create_makefile ‘drp_ext_rule_engine’
and in my C file i have:
#include “drp.h”
but if i have:
#include “…/drp.h”
either with or without the find_header it works fine. i am
building through the extensions attribute of gemspec, not by hand.
regards,
_c
On Thu, 29 Mar 2007, Christophe M. wrote:
Regards,
require ‘mkmf’#include “…/drp.h”
either with or without the find_header it works fine. i am
building through the extensions attribute of gemspec, not by hand.
you mean you are creating an extonf.rb?
-a
you mean you are creating an extonf.rb?
yes an extconf like i said above.
On Thu, 29 Mar 2007, Daniel B. wrote:
cc -dynamic -bundle -undefined suppress -flat_namespace -L"/usr/local/
lib" -o foo.bundle foo.o -ldl -lobjc
so even you are on a mac now eh dan?
-a
On Mar 28, 8:36 pm, Christophe M. [email protected] wrote:
Regards,
Dan
thanks but that doesn’t work, i still get errors
Works for me. I put a ‘bar.h’ in the toplevel directory. My extconf.rb
file looks like this:
require ‘mkmf’
find_header(‘bar.h’, ‘…’)
create_makefile(‘foo’)
The foo.c file looks like this:
#include <ruby.h>
#include <bar.h> /* Quotes or braces will work */
void Init_foo(){
VALUE mFoo = rb_define_class(“Foo”, rb_cObject);
}
$ ruby extconf.rb
checking for #include <bar.h>
… yes
creating Makefile
$ make
gcc -I. -I/usr/local/lib/ruby/1.8/i686-darwin8.9.1 -I/usr/local/lib/
ruby/1.8/i686-darwin8.9.1 -I. -I… -fno-common -g -O2 -pipe -fno-
common -c foo.c
cc -dynamic -bundle -undefined suppress -flat_namespace -L"/usr/local/
lib" -o foo.bundle foo.o -ldl -lobjc
After you run extconf.rb, open up the Makefile and look for INCFLAGS.
You should see “-I…”. If you don’t then something went seriously
wrong.
Regards,
Dan
On Mar 29, 7:41 am, [email protected] wrote:
On Thu, 29 Mar 2007, Daniel B. wrote:
cc -dynamic -bundle -undefined suppress -flat_namespace -L"/usr/local/
lib" -o foo.bundle foo.o -ldl -lobjcso even you are on a mac now eh dan?
Yah. This is why you’ll be seeing a bunch of new releases from the
sysutils project in the coming weeks.
I’ll probably setup bootcamp and do the Vista/OS X thing at some
point.
Dan
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs