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
···
--
Posted via http://www.ruby-forum.com/.
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
--
Posted via http://www.ruby-forum.com/.
find_header('drp.h', '..')
Regards,
Dan
On Mar 28, 7:49 pm, Christophe Mckeon <poly...@yahoo.com> 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.
Daniel Berger 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 Mar 28, 7:49 pm, Christophe Mckeon <poly...@yahoo.com> wrote:
--
Posted via http://www.ruby-forum.com/\.
you mean you are creating an extonf.rb?
-a
On Thu, 29 Mar 2007, Christophe Mckeon wrote:
Daniel Berger wrote:
On Mar 28, 7:49 pm, Christophe Mckeon <poly...@yahoo.com> 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 directorythis 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.
--
be kind whenever possible... it is always possible.
- the dalai lama
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 28, 8:36 pm, Christophe Mckeon <poly...@yahoo.com> wrote:
Daniel Berger wrote:
> On Mar 28, 7:49 pm, Christophe Mckeon <poly...@yahoo.com> 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
you mean you are creating an extonf.rb?
yes an extconf like i said above.
--
Posted via http://www.ruby-forum.com/\.
so even you are on a mac now eh dan?
-a
On Thu, 29 Mar 2007, Daniel Berger wrote:
cc -dynamic -bundle -undefined suppress -flat_namespace -L"/usr/local/
lib" -o foo.bundle foo.o -ldl -lobjc
--
be kind whenever possible... it is always possible.
- the dalai lama
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
On Mar 29, 7:41 am, ara.t.how...@noaa.gov wrote:
On Thu, 29 Mar 2007, Daniel Berger 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?