Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Ruby in C++

Hi there.

I have created a blank project in MS Visual C++ 2010.

New file, main.cpp.

Contents of the file is just:

#include <ruby.h>

1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2146: syntax error : missing ')' before identifier 'obj'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2146: syntax error : missing ')' before identifier 'obj'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2182: 'rb_enc_set_index' : illegal use of type 'void'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(90): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(91): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(92): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(93): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(93): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(93): error C2078: too many initializers
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(94): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(94): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(94): error C2078: too many initializers
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C2146: syntax error : missing ';' before identifier 'rb_enc_associate_index'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C2062: type 'int' unexpected
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2146: syntax error : missing ';' before identifier 'rb_enc_associate'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2146: syntax error : missing ')' before identifier 'dst'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2182: 'rb_enc_copy' : illegal use of type 'void'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C2146: syntax error : missing ';' before identifier 'rb_enc_str_new'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C2146: syntax error : missing ';' before identifier 'rb_enc_reg_new'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C2146: syntax error : missing ';' before identifier 'rb_enc_sprintf'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C2146: syntax error : missing ';' before identifier 'rb_enc_vsprintf'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C2146: syntax error : missing ';' before identifier 'rb_obj_encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2146: syntax error : missing ';' before identifier 'rb_enc_str_buf_cat'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C2146: syntax error : missing ';' before identifier 'rb_enc_uint_chr'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C2146: syntax error : missing ';' before identifier 'rb_external_str_new_with_enc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2146: syntax error : missing ';' before identifier 'rb_str_export_to_enc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2146: syntax error : missing ';' before identifier 'rb_str_conv_enc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2146: syntax error : missing ';' before identifier 'rb_str_conv_enc_opts'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186): error C2146: syntax error : missing ';' before identifier 'rb_intern3'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C2146: syntax error : missing ';' before identifier 'rb_interned_id_p'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C2086: 'int ID' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186) : see declaration of 'ID'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C2146: syntax error : missing ';' before identifier 'rb_enc_from_encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C2146: syntax error : missing ';' before identifier 'rb_enc_default_external'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C2146: syntax error : missing ';' before identifier 'rb_enc_default_internal'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2146: syntax error : missing ')' before identifier 'encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2182: 'rb_enc_set_default_external' : illegal use of type 'void'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2146: syntax error : missing ')' before identifier 'encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2182: 'rb_enc_set_default_internal' : illegal use of type 'void'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2146: syntax error : missing ';' before identifier 'rb_locale_charmap'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2146: syntax error : missing ')' before identifier 'klass'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C2146: syntax error : missing ';' before identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C2146: syntax error : missing ';' before identifier 'rb_cEncoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C2146: syntax error : missing ';' before identifier 'rb_str_encode'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(247): error C2146: syntax error : missing ')' before identifier 'opthash'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(247): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(248): error C2146: syntax error : missing ')' before identifier 'opthash'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(248): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(251): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(266): error C2146: syntax error : missing ';' before identifier 'rb_econv_open_exc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(266): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(266): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(266): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(279): error C2146: syntax error : missing ';' before identifier 'rb_econv_make_exception'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(279): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(279): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(279): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C2146: syntax error : missing ';' before identifier 'rb_econv_str_convert'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C2146: syntax error : missing ';' before identifier 'rb_econv_substr_convert'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C2146: syntax error : missing ';' before identifier 'rb_econv_str_append'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C2146: syntax error : missing ';' before identifier 'rb_econv_substr_append'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\io.h(57): error C2146: syntax error : missing ';' before identifier 'pid'
1>c:\ruby193\include\ruby-1.9.1\ruby\io.h(57): fatal error C1003: error count exceeds 100; stopping compilation

I just get a stream of errors.

Given some of the errors are "C++ does not support", I tried instead running as a .c file and I get pretty much the same.

1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2146: syntax error : missing ')' before identifier 'obj'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2061: syntax error : identifier 'obj'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2146: syntax error : missing ')' before identifier 'obj'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2061: syntax error : identifier 'obj'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2059: syntax error : ','
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C2061: syntax error : identifier 'rb_enc_associate_index'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C2143: syntax error : missing ')' before ','
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2061: syntax error : identifier 'rb_enc_associate'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2143: syntax error : missing ')' before ','
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2146: syntax error : missing ')' before identifier 'dst'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2061: syntax error : identifier 'dst'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2059: syntax error : ','
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C2061: syntax error : identifier 'rb_enc_str_new'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C2061: syntax error : identifier 'rb_enc_reg_new'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C2061: syntax error : identifier 'rb_enc_sprintf'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C2061: syntax error : identifier 'rb_enc_vsprintf'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C2061: syntax error : identifier 'rb_obj_encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2061: syntax error : identifier 'rb_enc_str_buf_cat'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2061: syntax error : identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2059: syntax error : ','
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C2061: syntax error : identifier 'rb_enc_uint_chr'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C2061: syntax error : identifier 'rb_external_str_new_with_enc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2061: syntax error : identifier 'rb_str_export_to_enc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2143: syntax error : missing ')' before ','
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2061: syntax error : identifier 'rb_str_conv_enc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2061: syntax error : identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2059: syntax error : ','
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2061: syntax error : identifier 'rb_str_conv_enc_opts'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2061: syntax error : identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2059: syntax error : ','
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186): error C2061: syntax error : identifier 'rb_intern3'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C2061: syntax error : identifier 'rb_interned_id_p'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C2061: syntax error : identifier 'rb_enc_from_encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C2061: syntax error : identifier 'rb_enc_default_external'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C2061: syntax error : identifier 'rb_enc_default_internal'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C2059: syntax error : 'type'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2146: syntax error : missing ')' before identifier 'encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2061: syntax error : identifier 'encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2146: syntax error : missing ')' before identifier 'encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2061: syntax error : identifier 'encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2061: syntax error : identifier 'rb_locale_charmap'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2146: syntax error : missing ')' before identifier 'klass'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2061: syntax error : identifier 'klass'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C2059: syntax error : ';'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(225): error C2054: expected '(' to follow 'inline'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(226): error C2085: 'rb_enc_dummy_p' : not in formal parameter list
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(226): error C2143: syntax error : missing ';' before '{'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C2061: syntax error : identifier 'rb_str_encode'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): fatal error C1003: error count exceeds 100; stopping compilation

Any ideas?
 

e

Sponsor

You have to ensure that the Ruby header files (all the *.h files) are within your include paths. I don't use Visual Studio, so I'm not familiar how to do this, but look up how to link any library to your project in Visual Studio to ensure that header files are properly included. These errors are generated a compile time, not link time, so its not a matter of linking but simply that definitions are missing (since it cannot find the header files).
 
I, quite honestly, do not have a clue what I'm doing.

Nowhere says what I have to link or include to use ruby.h.

Under "include directories" I have:

C:\Ruby193\include\ruby-1.9.1\i386-mingw32\ruby;C:\Ruby193\include\ruby-1.9.1\i386-mingw32;C:\Ruby193\include\ruby-1.9.1\ruby\backward;C:\Ruby193\include\ruby-1.9.1\ruby;C:\Ruby193\include\ruby-1.9.1;C:\Ruby193\lib\ruby\1.9.1;C:\Ruby193\include;$(IncludePath)

...the include directory of ruby and it's subdirectories.

I mean presumably I have to link the lib directory? and

ugh nevermind I should read up more, I'm lost.
 
@regashi: doesn't make a difference; it's still including the same file in the end, and according to VC++ ruby.h is full of syntax errors, which is what I don't understand.
 
all those errors are caused by just one line that fucks the rest.
looks like the problem is VALUE not being declared.

Code:
#if SIZEOF_LONG != SIZEOF_VOIDP

# error ---->> ruby requires sizeof(void*) == sizeof(long) to be compiled. <<----

#else

typedef unsigned long VALUE;

typedef unsigned long ID;

#endif

Can you comment out the include "ruby.h" and test the
Code:
 

if( sizeof(void*) == sizeof(long))

{ printf("yes"); }

else

{ printf("no"); }

 
 
another idea just came to my mind.
Theres 2 ruby.h (ruby.h and ruby/ruby.h), if you are including both directories maybe the compiler its getting the wrong one.
 
Ok I tried specifically including the first ruby.h

#include "C:\Ruby193\include\ruby-1.9.1\ruby.h"

*Something* has happened, because now it gets to a different error by the time it reaches 100.

1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2146: syntax error : missing ')' before identifier 'obj'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(87): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2146: syntax error : missing ')' before identifier 'obj'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2182: 'rb_enc_set_index' : illegal use of type 'void'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(88): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(90): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(91): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(92): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(93): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(93): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(93): error C2078: too many initializers
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(94): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(94): error C2065: 'VALUE' : undeclared identifier
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(94): error C2078: too many initializers
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C2146: syntax error : missing ';' before identifier 'rb_enc_associate_index'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95): error C2062: type 'int' unexpected
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2146: syntax error : missing ';' before identifier 'rb_enc_associate'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(96): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2146: syntax error : missing ')' before identifier 'dst'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2182: 'rb_enc_copy' : illegal use of type 'void'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(97): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C2146: syntax error : missing ';' before identifier 'rb_enc_str_new'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(99): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C2146: syntax error : missing ';' before identifier 'rb_enc_reg_new'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(100): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C2146: syntax error : missing ';' before identifier 'rb_enc_sprintf'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(101): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C2146: syntax error : missing ';' before identifier 'rb_enc_vsprintf'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(102): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C2146: syntax error : missing ';' before identifier 'rb_obj_encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(105): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2146: syntax error : missing ';' before identifier 'rb_enc_str_buf_cat'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(106): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C2146: syntax error : missing ';' before identifier 'rb_enc_uint_chr'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(107): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C2146: syntax error : missing ';' before identifier 'rb_external_str_new_with_enc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(109): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2146: syntax error : missing ';' before identifier 'rb_str_export_to_enc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(110): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2146: syntax error : missing ';' before identifier 'rb_str_conv_enc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(111): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2146: syntax error : missing ';' before identifier 'rb_str_conv_enc_opts'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(112): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186): error C2146: syntax error : missing ';' before identifier 'rb_intern3'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C2146: syntax error : missing ';' before identifier 'rb_interned_id_p'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C2086: 'int ID' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(186) : see declaration of 'ID'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(187): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C2146: syntax error : missing ';' before identifier 'rb_enc_from_encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(194): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C2146: syntax error : missing ';' before identifier 'rb_enc_default_external'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(208): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C2146: syntax error : missing ';' before identifier 'rb_enc_default_internal'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(209): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2146: syntax error : missing ')' before identifier 'encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2182: 'rb_enc_set_default_external' : illegal use of type 'void'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(210): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2146: syntax error : missing ')' before identifier 'encoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2182: 'rb_enc_set_default_internal' : illegal use of type 'void'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(211): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2146: syntax error : missing ';' before identifier 'rb_locale_charmap'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2146: syntax error : missing ')' before identifier 'klass'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(212): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C2146: syntax error : missing ';' before identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C2146: syntax error : missing ';' before identifier 'rb_cEncoding'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C2146: syntax error : missing ';' before identifier 'rb_str_encode'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C2146: syntax error : missing ')' before identifier 'str'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(244): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(247): error C2146: syntax error : missing ')' before identifier 'opthash'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(247): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(248): error C2146: syntax error : missing ')' before identifier 'opthash'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(248): error C2059: syntax error : ')'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(251): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(266): error C2146: syntax error : missing ';' before identifier 'rb_econv_open_exc'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(266): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(266): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(266): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(279): error C2146: syntax error : missing ';' before identifier 'rb_econv_make_exception'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(279): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(279): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(279): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C2146: syntax error : missing ';' before identifier 'rb_econv_str_convert'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(288): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C2146: syntax error : missing ';' before identifier 'rb_econv_substr_convert'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(289): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C2146: syntax error : missing ';' before identifier 'rb_econv_str_append'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(290): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C2146: syntax error : missing ';' before identifier 'rb_econv_substr_append'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C2086: 'int VALUE' : redefinition
1> c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(95) : see declaration of 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C2061: syntax error : identifier 'VALUE'
1>c:\ruby193\include\ruby-1.9.1\ruby\encoding.h(291): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>c:\ruby193\include\ruby-1.9.1\ruby\io.h(57): error C2146: syntax error : missing ';' before identifier 'pid'
1>c:\ruby193\include\ruby-1.9.1\ruby\io.h(57): fatal error C1003: error count exceeds 100; stopping compilation

It still thinks there are syntax errors and can't find VALUE. :/
 
I have tried switching to Code::Blocks instead of Visual C++. It no longer gets the syntax errors nor the "C++ does not support default-int" errors.

It still gets the "VALUE was not declared in this scope" errors however.



Edit: modifying ruby.h to include <config.h> instead of <ruby/config.h> fixed all but one error. o.O

`RUBY_EXTERN' does not name a type


Edit: I added

Code:
#ifndef RUBY_EXTERN

#define RUBY_EXTERN extern

#endif

Before including ruby.h.

No errors!

No idea if that's a sensible thing to do. No idea if ruby actually works. But it's a start.
 
Yeah, I did embedding Ruby in C++ before and it's not a pleasant experience :P To be honest with you, the people making Ruby don't care a lot about whether it works on windows, let alone whether you can embed it with MSVC. IIRC 1.9.x has more issues with it than just the include business. FWIW I had a better time embedding 1.8.x (Which is what RMXP uses)

(Oh I just saw you switched to C::B, so you're using g++ which should give you less issues)

As far as what to define RUBY_EXTERN as, I believe somewhere in the Ruby include files you should see where it's trying to define RUBU_EXTERN, but for some reason it skips out of all of the #ifndefs (maybe you are using a newer version of g++ than they did and they by default restricted it to a certain range). Find where they did that and probably setting it to whatever they tried to define it for g++ will do it for you.
 
I figured it might be a Windows thing (since in my searching everyone says Ruby hates Windows). Bah.

Maybe that's why RM is stuck to 1.8.x.
 
Ok... possibly working... possibly.

New problems, in using a cpp file I found.

Sample code from the cpp:

Code:
 

  if (eclass == rb_eRuntimeError && RSTRING(einfo)->len == 0) {

//...

 

Code:
 

// parts from ruby.h

 

struct RArray {

    struct RBasic basic;

    union {

    struct {

        long len;

        union {

        long capa;

        VALUE shared;

        } aux;

        VALUE *ptr;

    } heap;

    VALUE ary[RARRAY_EMBED_LEN_MAX];

    } as;

};

 

struct RString {

    struct RBasic basic;

    union {

    struct {

        long len;

        char *ptr;

        union {

        long capa;

        VALUE shared;

        } aux;

    } heap;

    char ary[RSTRING_EMBED_LEN_MAX + 1];

    } as;

};

Error:
|87|error: 'struct RArray' has no member named 'ptr'|
|99|error: 'struct RString' has no member named 'len'|
|105|error: 'struct RString' has no member named 'len'|
|111|error: 'struct RString' has no member named 'len'|
|113|error: 'struct RString' has no member named 'ptr'|
|114|error: 'struct RString' has no member named 'ptr'|
|115|error: 'struct RString' has no member named 'ptr'|
|119|error: 'struct RString' has no member named 'ptr'|
|126|error: 'struct RString' has no member named 'len'|
|142|error: 'struct RArray' has no member named 'len'|
|143|error: 'struct RArray' has no member named 'ptr'|
|145|error: 'struct RArray' has no member named 'ptr'|
|148|error: 'struct RArray' has no member named 'len'|
|149|error: 'struct RArray' has no member named 'len'|
|151|error: 'struct RArray' has no member named 'len'|

As you can see above - it does.

Agh.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top