Created
October 8, 2013 16:28
-
-
Save noelwarr/6887398 to your computer and use it in GitHub Desktop.
CGAL and Ruby not playing nice together
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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