D
Daniel Berger
Hi all,
Is it possible to wrap the C++ STL stuff? Say, for example, vector?
#include "ruby.h"
#include <vector>
using namespace std;
struct cvector{
vector<VALUE> array(0);
};
void Init_cvector(){
VALUE cVector = rb_define_class("CVector", rb_cObject);
}
When I try to compile this (using g++ on OS X) I get:
/usr/local/lib/ruby/1.8/i686-darwin8.9.1/intern.h:207: error: use of
enum 'rb_thread_status' without previous declaration
/usr/local/lib/ruby/1.8/i686-darwin8.9.1/intern.h:207: error: invalid
type in declaration before ';' token
cvector.c:6: error: expected identifier before numeric constant
cvector.c:6: error: expected ',' or '...' before numeric constant
cvector.c: In function 'void Init_cvector()':
cvector.c:10: warning: unused variable 'cVector'
make: *** [cvector.o] Error 1
Thanks,
Dan
Is it possible to wrap the C++ STL stuff? Say, for example, vector?
#include "ruby.h"
#include <vector>
using namespace std;
struct cvector{
vector<VALUE> array(0);
};
void Init_cvector(){
VALUE cVector = rb_define_class("CVector", rb_cObject);
}
When I try to compile this (using g++ on OS X) I get:
/usr/local/lib/ruby/1.8/i686-darwin8.9.1/intern.h:207: error: use of
enum 'rb_thread_status' without previous declaration
/usr/local/lib/ruby/1.8/i686-darwin8.9.1/intern.h:207: error: invalid
type in declaration before ';' token
cvector.c:6: error: expected identifier before numeric constant
cvector.c:6: error: expected ',' or '...' before numeric constant
cvector.c: In function 'void Init_cvector()':
cvector.c:10: warning: unused variable 'cVector'
make: *** [cvector.o] Error 1
Thanks,
Dan