Skip to content

Instantly share code, notes, and snippets.

@noelwarr
Created October 8, 2013 16:28
Show Gist options
  • Save noelwarr/6887398 to your computer and use it in GitHub Desktop.
Save noelwarr/6887398 to your computer and use it in GitHub Desktop.
CGAL and Ruby not playing nice together
//hello_world.cpp
//The following DOESN'T compile
#include <ruby.h>
#include <boost/shared_ptr.hpp>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/create_straight_skeleton_2.h> //ADDING THIS CAUSES COMPILATION TO FAIL
static VALUE tosCore;
static VALUE my_function( VALUE self )
{
VALUE str = rb_str_new2( "Hello World!" );
return str;
}
extern "C"
void Init_hello_world( void )
{
tosCore = rb_define_module("Core");
rb_define_module_function(
tosCore, "my_method", reinterpret_cast<VALUE(*)(...)>(my_function),0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment