3

I am in the process of releasing my Ruby C/C++ extension and try to make sure that all libraries required are listed in extconf.rb. I have not been able to figure out how to require the boost library and especially the dynamic_bitset<> class.

What I tried so far:

# Require used libraries
have_library("stdc++")
have_library("boost", "boost::dynamic_bitset<>")

Even though I've got boost installed, and the extension compiles perfectly I'm getting this:

$ ruby extconf.rb
checking for main() in -lstdc++... yes 
checking for boost::dynamic_bitset<>() in -lboost... no

Any ideas on how to properly require boost to be installed?

halfdan
  • 33,545
  • 8
  • 78
  • 87

1 Answers1

0

dynamic_bitset is not defined in a library, it's a header-only boost component. You can find out which boost components are of this type here:

http://www.boost.org/doc/libs/1_57_0/more/getting_started/unix-variants.html#header-only-libraries

I tested it out, the example at

http://www.boost.org/doc/libs/1_57_0/libs/dynamic_bitset/example/example1.cpp

compiled without any libraries:

g++ example1.cpp -o boost_test

So you don't have to look for the boost library at all, but you might want to look for the boost header using have_header(), find_header(), dir_config().

If you need inspiration, google for extconf.rb and boost and have_header, you might find some extconf.rb files on github.

codegourmet
  • 261
  • 3
  • 4