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

**URL:** <https://www.ruby-forum.com/t/help-with-adding-header-files-for-mkmf-new-to-swig-mkmf/118221>\
**Category:** Ruby\
**Created:** [October 24, 2007, 10:20pm UTC](https://www.ruby-forum.com/t/help-with-adding-header-files-for-mkmf-new-to-swig-mkmf/118221 "2007-10-24T22:20:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![unknown](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/u/4bbf92/32.png) [@unknown](https://www.ruby-forum.com/u/unknown)\
**Post date:** [October 24, 2007, 10:20pm UTC](https://www.ruby-forum.com/t/help-with-adding-header-files-for-mkmf-new-to-swig-mkmf/118221/1 "2007-10-24T22:20:49Z")

</div>

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’)
