Help with adding header files for 'mkmf' - new to Swig/mkmf

Discussion in 'Ruby' started by james.d.masters@gmail.com, Oct 24, 2007.

  1. Guest

    Hi,

    I'm trying to extend a simple function from a large C++ API library
    for Ruby (OpenAccess). Ultimately I'd like to add functionality over
    time; however, I want to get a simple test case up and running as a
    proof-of-concept. I believe the problem is properly pointing to the
    large C++ library. Let me begin with the problem seen (after using
    Swig and extconf.rb):

    irb(main):001:0> require 'libtest'
    LoadError: ./libtest.so: undefined symbol:
    _ZNK12OpenAccess_46oaFile6existsEv - ./libtest.so
    from ./libtest.so
    from (irb):1

    In my libtest.cpp file I have:

    #include "oaDesignDB.h"

    And in my extconf.rb file:

    require 'mkmf'
    $libs = append_library($libs, "supc++")

    # This does not seem to add the path to the "-I" option in the make
    file
    # even though the header is found.
    find_header('oaDesignDB.h', '/path/to/the/header')

    # And this does not work also even though $INCFLAGS has a value before
    # as "-I$(topdir)" and with the added path afterwards... it just
    doesn't get
    # into the make file for some reason
    # $INCFLAGS += " -I#{path}"

    create_makefile('libtest_wrap')
    , Oct 24, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Smith

    Header files included in header files

    John Smith, Jul 21, 2004, in forum: C Programming
    Replies:
    18
    Views:
    603
    Jack Klein
    Jul 24, 2004
  2. Replies:
    3
    Views:
    1,296
    Walter Roberson
    May 1, 2006
  3. mlt
    Replies:
    2
    Views:
    831
    Jean-Marc Bourguet
    Jan 31, 2009
  4. Daniel Berger
    Replies:
    5
    Views:
    177
    KUBO Takehiro
    Jun 29, 2005
  5. anne001
    Replies:
    0
    Views:
    235
    anne001
    Jan 15, 2006
Loading...

Share This Page