I am learning how to write Ruby C extensions and I'm past the simplest examples. I was trying to achieve something with sockets so I attempted to create an extension which would define a class under rb_cIPSocket
.
At the top of my C file I have:
#include "rubysocket.h"
And I am receiving:
...s.c:3:31: error: rubysocket.h: No such file or directory
Which is most probably the case. However, I tried all possible paths:
#include "rubysocket.h"
#include "socket/rubysocket.h"
#include "ext/socket/rubysocket.h"
#include <rubysocket.h>
#include <socket/rubysocket.h>
#include <ext/socket/rubysocket.h>
And this is my extconf.rb
:
require 'mkmf'
dir_config("my_ext")
have_library("c", "main")
create_makefile("my_ext")
And so on. What am I actually missing here? Why can't I include that header file? I am using OSX with RVM and Ruby 1.9.3-p448. Thank you.