Including ruby.h in c program fails to compile

57 Aufrufe
Direkt zur ersten ungelesenen Nachricht

Michael West

ungelesen,
04.08.2016, 21:56:5204.08.16
an RubyInstaller
Version of Windows  = Windows 10 Pro x64  Version 1511 OS Build 10586.494
  • Version of Ruby (ruby --version) = ruby 2.2.4p230 (2015-12-16 revision 53155) [x64-mingw32]
  • Version of RubyGems (gem --version) = 2.4.5.1
  • Indicate that you have installed DevKit (according to the instructions) and which version (exact filename).  = YES - DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
  • Against which package (knapsack filename or any other obtained from the web) you're trying to link the gem. = N/A
  • Full command line executed that caused the error (gem install ...) = N/A
  • Full output of the error. To copy from the console please see this article. = N/A
  • Contents of mkmf.log that are generated inside the target gem directory (use pastie or gist to host the contents) = N/A

I am trying to write a gem file that requires some c code that ultimately will return a hash back to ruby.  I need to include the ruby.h file to compile it.  When I include that file, I get a huge number of notes, warnings, and errors back.  While it seems to smell of a processor mismatch (32 vs 64), I cannot find anything in my build environment that force anything to 32 bit during the build.  What is the best way to include the necessary header files to use in a c application that will eventually be the c source in a gem.

Below is my dev related versions.  I am writing the C code in the latest CLION IDE.  I can provide more information if needed.

MinGW-w64 (w64 5.0)
CMake 3.5.2
GDB: GNU gdb 7.10.1

Here is the relevant CMAKE Settings:

set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
include_directories(C:/Ruby22-x64/include/ruby-2.2.0 C:/Ruby22-x64/include/ruby-2.2.0/ruby C:/Ruby22-x64/include/ruby-2.2.0/x64-mingw32)

The remaining is the build failure output

"C:\Program Files (x86)\JetBrains\CLion 2016.2\bin\cmake\bin\cmake.exe" --build C:\Users\Michael\.CLion2016.2\system\cmake\generated\GetAddresses-1a1192dd\1a1192dd\Debug --target GetAddresses -- -j 8
Scanning dependencies of target GetAddresses
[ 25%] Building C object CMakeFiles/GetAddresses.dir/main.c.obj
[ 50%] Building C object CMakeFiles/GetAddresses.dir/GetAdapterInfoHelper.c.obj
[ 75%] Building C object CMakeFiles/GetAddresses.dir/GetAdaptersAddressHelper.c.obj
In file included from C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:24:0,
                 from C:/PROGRA~2/MINGW-~1/I686-6~1.0-P/mingw32/i686-w64-mingw32/include/sys/stat.h:14,
                 from C:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:31,
                 from C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:79:22: error: unknown type name 'VALUE'
 int rb_enc_get_index(VALUE obj);
                      ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:80:23: error: unknown type name 'VALUE'
 void rb_enc_set_index(VALUE obj, int encindex);
                       ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:88:1: error: unknown type name 'VALUE'
 VALUE rb_enc_associate_index(VALUE, int);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:88:37: error: expected ')' before 'int'
 VALUE rb_enc_associate_index(VALUE, int);
                                     ^~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:89:1: error: unknown type name 'VALUE'
 VALUE rb_enc_associate(VALUE, rb_encoding*);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:89:31: error: expected ')' before 'rb_encoding'
 VALUE rb_enc_associate(VALUE, rb_encoding*);
                               ^~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:90:18: error: unknown type name 'VALUE'
 void rb_enc_copy(VALUE dst, VALUE src);
                  ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:90:29: error: unknown type name 'VALUE'
 void rb_enc_copy(VALUE dst, VALUE src);
                             ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:92:1: error: unknown type name 'VALUE'
 VALUE rb_enc_str_new(const char*, long, rb_encoding*);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:93:1: error: unknown type name 'VALUE'
 VALUE rb_enc_str_new_cstr(const char*, rb_encoding*);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:94:1: error: unknown type name 'VALUE'
 VALUE rb_enc_str_new_static(const char*, long, rb_encoding*);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:95:1: error: unknown type name 'VALUE'
 VALUE rb_enc_reg_new(const char*, long, rb_encoding*, int);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:96:13: error: unknown type name 'VALUE'
 PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
             ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:96:68: error: expected declaration specifiers or '...' before numeric constant
 PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
                                                                    ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:96:71: error: expected declaration specifiers or '...' before numeric constant
 PRINTF_ARGS(VALUE rb_enc_sprintf(rb_encoding *, const char*, ...), 2, 3);
                                                                       ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:97:1: error: unknown type name 'VALUE'
 VALUE rb_enc_vsprintf(rb_encoding *, const char*, va_list);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:100:1: error: unknown type name 'VALUE'
 VALUE rb_obj_encoding(VALUE);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:101:1: error: unknown type name 'VALUE'
 VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:101:26: error: unknown type name 'VALUE'
 VALUE rb_enc_str_buf_cat(VALUE str, const char *ptr, long len, rb_encoding *enc);
                          ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:102:1: error: unknown type name 'VALUE'
 VALUE rb_enc_uint_chr(unsigned int code, rb_encoding *enc);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:104:1: error: unknown type name 'VALUE'
 VALUE rb_external_str_new_with_enc(const char *ptr, long len, rb_encoding *);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:105:1: error: unknown type name 'VALUE'
 VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:105:35: error: expected ')' before 'rb_encoding'
 VALUE rb_str_export_to_enc(VALUE, rb_encoding *);
                                   ^~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:106:1: error: unknown type name 'VALUE'
 VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:106:23: error: unknown type name 'VALUE'
 VALUE rb_str_conv_enc(VALUE str, rb_encoding *from, rb_encoding *to);
                       ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:107:1: error: unknown type name 'VALUE'
 VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:107:28: error: unknown type name 'VALUE'
 VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts);
                            ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:107:88: error: unknown type name 'VALUE'
 VALUE rb_str_conv_enc_opts(VALUE str, rb_encoding *from, rb_encoding *to, int ecflags, VALUE ecopts);
                                                                                        ^~~~~
In file included from C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:24:0,
                 from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:124:13: error: unknown type name 'VALUE'
 PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
             ^
In file included from C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:24:0,
                 from C:/PROGRA~2/MINGW-~1/I686-6~1.0-P/mingw32/i686-w64-mingw32/include/sys/stat.h:14,
                 from C:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:31,
                 from C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:124:82: error: expected ';', ',' or ')' before numeric constant
 PRINTF_ARGS(NORETURN(void rb_enc_raise(rb_encoding *, VALUE, const char*, ...)), 3, 4);
                                                                                  ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:201:1: error: unknown type name 'ID'
 ID rb_intern3(const char*, long, rb_encoding*);
 ^~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:202:1: error: unknown type name 'ID'
 ID rb_interned_id_p(const char *, long, rb_encoding *);
 ^~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:209:1: error: unknown type name 'VALUE'
 VALUE rb_enc_from_encoding(rb_encoding *enc);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:229:1: error: unknown type name 'VALUE'
 VALUE rb_enc_default_external(void);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:230:1: error: unknown type name 'VALUE'
 VALUE rb_enc_default_internal(void);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:231:34: error: unknown type name 'VALUE'
 void rb_enc_set_default_external(VALUE encoding);
                                  ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:232:34: error: unknown type name 'VALUE'
 void rb_enc_set_default_internal(VALUE encoding);
                                  ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:233:1: error: unknown type name 'VALUE'
 VALUE rb_locale_charmap(VALUE klass);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:233:25: error: unknown type name 'VALUE'
 VALUE rb_locale_charmap(VALUE klass);
                         ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:241:1: error: unknown type name 'ID'
 ID rb_check_id_cstr(const char *ptr, long len, rb_encoding *enc);
 ^~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:242:1: error: unknown type name 'VALUE'
 VALUE rb_check_symbol_cstr(const char *ptr, long len, rb_encoding *enc);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:244:1: error: unknown type name 'RUBY_EXTERN'
 RUBY_EXTERN VALUE rb_cEncoding;
 ^~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:244:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'rb_cEncoding'
 RUBY_EXTERN VALUE rb_cEncoding;
                   ^~~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:260:1: error: unknown type name 'VALUE'
 VALUE rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:260:21: error: unknown type name 'VALUE'
 VALUE rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts);
                     ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:260:32: error: unknown type name 'VALUE'
 VALUE rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts);
                                ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:260:55: error: unknown type name 'VALUE'
 VALUE rb_str_encode(VALUE str, VALUE to, int ecflags, VALUE ecopts);
                                                       ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:263:30: error: unknown type name 'VALUE'
 int rb_econv_prepare_options(VALUE opthash, VALUE *ecopts, int ecflags);
                              ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:263:45: error: unknown type name 'VALUE'
 int rb_econv_prepare_options(VALUE opthash, VALUE *ecopts, int ecflags);
                                             ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:264:27: error: unknown type name 'VALUE'
 int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts);
                           ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:264:42: error: unknown type name 'VALUE'
 int rb_econv_prepare_opts(VALUE opthash, VALUE *ecopts);
                                          ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:267:108: error: unknown type name 'VALUE'
 rb_econv_t *rb_econv_open_opts(const char *source_encoding, const char *destination_encoding, int ecflags, VALUE ecopts);
                                                                                                            ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:282:1: error: unknown type name 'VALUE'
 VALUE rb_econv_open_exc(const char *senc, const char *denc, int ecflags);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:295:1: error: unknown type name 'VALUE'
 VALUE rb_econv_make_exception(rb_econv_t *ec);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:304:1: error: unknown type name 'VALUE'
 VALUE rb_econv_str_convert(rb_econv_t *ec, VALUE src, int flags);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:304:44: error: unknown type name 'VALUE'
 VALUE rb_econv_str_convert(rb_econv_t *ec, VALUE src, int flags);
                                            ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:305:1: error: unknown type name 'VALUE'
 VALUE rb_econv_substr_convert(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:305:47: error: unknown type name 'VALUE'
 VALUE rb_econv_substr_convert(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, int flags);
                                               ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:306:1: error: unknown type name 'VALUE'
 VALUE rb_econv_str_append(rb_econv_t *ec, VALUE src, VALUE dst, int flags);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:306:43: error: unknown type name 'VALUE'
 VALUE rb_econv_str_append(rb_econv_t *ec, VALUE src, VALUE dst, int flags);
                                           ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:306:54: error: unknown type name 'VALUE'
 VALUE rb_econv_str_append(rb_econv_t *ec, VALUE src, VALUE dst, int flags);
                                                      ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:307:1: error: unknown type name 'VALUE'
 VALUE rb_econv_substr_append(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:307:46: error: unknown type name 'VALUE'
 VALUE rb_econv_substr_append(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags);
                                              ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:307:86: error: unknown type name 'VALUE'
 VALUE rb_econv_substr_append(rb_econv_t *ec, VALUE src, long byteoff, long bytesize, VALUE dst, int flags);
                                                                                      ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:308:1: error: unknown type name 'VALUE'
 VALUE rb_econv_append(rb_econv_t *ec, const char *bytesrc, long bytesize, VALUE dst, int flags);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/encoding.h:308:75: error: unknown type name 'VALUE'
 VALUE rb_econv_append(rb_econv_t *ec, const char *bytesrc, long bytesize, VALUE dst, int flags);
                                                                           ^~~~~
In file included from C:/PROGRA~2/MINGW-~1/I686-6~1.0-P/mingw32/i686-w64-mingw32/include/sys/stat.h:14:0,
                 from C:/Ruby22-x64/include/ruby-2.2.0/ruby/defines.h:31,
                 from C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:29,
                 from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:68:5: error: unknown type name 'VALUE'
     VALUE pathv;  /* pathname for file */
     ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:73:5: error: unknown type name 'VALUE'
     VALUE tied_io_for_writing;
     ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:85:9: error: unknown type name 'VALUE'
         VALUE ecopts;
         ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:92:5: error: unknown type name 'VALUE'
     VALUE writeconv_asciicompat;
     ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:95:5: error: unknown type name 'VALUE'
     VALUE writeconv_pre_ecopts;
     ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:97:5: error: unknown type name 'VALUE'
     VALUE write_lock;
     ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:131:31: error: unknown type name 'VALUE'
 rb_io_t *rb_io_make_open_file(VALUE obj);
                               ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:147:1: error: unknown type name 'VALUE'
 VALUE rb_io_get_io(VALUE io);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:147:20: error: unknown type name 'VALUE'
 VALUE rb_io_get_io(VALUE io);
                    ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:148:1: error: unknown type name 'VALUE'
 VALUE rb_io_check_io(VALUE io);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:148:22: error: unknown type name 'VALUE'
 VALUE rb_io_check_io(VALUE io);
                      ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:149:1: error: unknown type name 'VALUE'
 VALUE rb_io_get_write_io(VALUE io);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:149:26: error: unknown type name 'VALUE'
 VALUE rb_io_get_write_io(VALUE io);
                          ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:150:1: error: unknown type name 'VALUE'
 VALUE rb_io_set_write_io(VALUE io, VALUE w);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:150:26: error: unknown type name 'VALUE'
 VALUE rb_io_set_write_io(VALUE io, VALUE w);
                          ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:150:36: error: unknown type name 'VALUE'
 VALUE rb_io_set_write_io(VALUE io, VALUE w);
                                    ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:155:35: error: unknown type name 'VALUE'
 int rb_io_extract_encoding_option(VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p);
                                   ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:156:24: error: unknown type name 'VALUE'
 ssize_t rb_io_bufwrite(VALUE io, const void *buf, size_t size);
                        ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:162:1: error: unknown type name 'VALUE'
 VALUE rb_io_taint_check(VALUE);
 ^~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/io.h:169:1: error: unknown type name 'VALUE'
 VALUE rb_stat_new(const struct stat *);
 ^~~~~
In file included from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:0:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:111:14: error: size of array 'ruby_check_sizeof_voidp' is negative
 typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
              ^~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:0:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_freeze_inline':
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:487:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & T_MASK)
                                ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1129:44: note: in expansion of macro 'BUILTIN_TYPE'
 #define FL_ABLE(x) (!SPECIAL_CONST_P(x) && BUILTIN_TYPE(x) != T_NODE)
                                            ^~~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1156:9: note: in expansion of macro 'FL_ABLE'
     if (FL_ABLE(x)) {
         ^
In file included from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:0:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1082:23: note: in expansion of macro 'R_CAST'
 #define RBASIC(obj)  (R_CAST(RBasic)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1148:28: note: in expansion of macro 'RBASIC'
 #define OBJ_FREEZE_RAW(x) (RBASIC(x)->flags |= FL_FREEZE)
                            ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1157:2: note: in expansion of macro 'OBJ_FREEZE_RAW'
  OBJ_FREEZE_RAW(x);
  ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1082:23: note: in expansion of macro 'R_CAST'
 #define RBASIC(obj)  (R_CAST(RBasic)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:784:28: note: in expansion of macro 'RBASIC'
 #define RBASIC_CLASS(obj) (RBASIC(obj)->klass)
                            ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1158:6: note: in expansion of macro 'RBASIC_CLASS'
  if (RBASIC_CLASS(x) && !(RBASIC(x)->flags & FL_SINGLETON)) {
      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1082:23: note: in expansion of macro 'R_CAST'
 #define RBASIC(obj)  (R_CAST(RBasic)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1158:27: note: in expansion of macro 'RBASIC'
  if (RBASIC_CLASS(x) && !(RBASIC(x)->flags & FL_SINGLETON)) {
                           ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_data_object_get':
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1192:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
     return ((struct RData *)obj)->data;
             ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_written':
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1082:23: note: in expansion of macro 'R_CAST'
 #define RBASIC(obj)  (R_CAST(RBasic)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1209:39: note: in expansion of macro 'RBASIC'
 #define OBJ_PROMOTED_RAW(x)         ((RBASIC(x)->flags & (FL_PROMOTED0|FL_PROMOTED1)) == (FL_PROMOTED0|FL_PROMOTED1))
                                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1271:10: note: in expansion of macro 'OBJ_PROMOTED_RAW'
      if (OBJ_PROMOTED_RAW(a) && !OBJ_PROMOTED_RAW(b)) {
          ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1082:23: note: in expansion of macro 'R_CAST'
 #define RBASIC(obj)  (R_CAST(RBasic)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1209:39: note: in expansion of macro 'RBASIC'
 #define OBJ_PROMOTED_RAW(x)         ((RBASIC(x)->flags & (FL_PROMOTED0|FL_PROMOTED1)) == (FL_PROMOTED0|FL_PROMOTED1))
                                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1271:34: note: in expansion of macro 'OBJ_PROMOTED_RAW'
      if (OBJ_PROMOTED_RAW(a) && !OBJ_PROMOTED_RAW(b)) {
                                  ^
In file included from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:0:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_num2char_inline':
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:487:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & T_MASK)
                                ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:360:50: note: in expansion of macro 'BUILTIN_TYPE'
 #define DYNAMIC_SYM_P(x) (!SPECIAL_CONST_P(x) && BUILTIN_TYPE(x) == (T_SYMBOL))
                                                  ^~~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:361:39: note: in expansion of macro 'DYNAMIC_SYM_P'
 #define SYMBOL_P(x) (STATIC_SYM_P(x)||DYNAMIC_SYM_P(x))
                                       ^~~~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:500:25: note: in expansion of macro 'SYMBOL_P'
  ((type) == T_SYMBOL) ? SYMBOL_P(obj) : \
                         ^~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1344:9: note: in expansion of macro 'RB_TYPE_P'
     if (RB_TYPE_P(x, T_STRING) && (RSTRING_LEN(x)>=1))
         ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:487:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & T_MASK)
                                ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:492:74: note: in expansion of macro 'BUILTIN_TYPE'
 #define RB_FLOAT_TYPE_P(obj) (FLONUM_P(obj) || (!SPECIAL_CONST_P(obj) && BUILTIN_TYPE(obj) == T_FLOAT))
                                                                          ^~~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:501:24: note: in expansion of macro 'RB_FLOAT_TYPE_P'
  ((type) == T_FLOAT) ? RB_FLOAT_TYPE_P(obj) : \
                        ^~~~~~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1344:9: note: in expansion of macro 'RB_TYPE_P'
     if (RB_TYPE_P(x, T_STRING) && (RSTRING_LEN(x)>=1))
         ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:487:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & T_MASK)
                                ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:502:28: note: in expansion of macro 'BUILTIN_TYPE'
  (!SPECIAL_CONST_P(obj) && BUILTIN_TYPE(obj) == (type)))
                            ^~~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1344:9: note: in expansion of macro 'RB_TYPE_P'
     if (RB_TYPE_P(x, T_STRING) && (RSTRING_LEN(x)>=1))
         ^
In file included from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:0:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1082:23: note: in expansion of macro 'R_CAST'
 #define RBASIC(obj)  (R_CAST(RBasic)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:862:8: note: in expansion of macro 'RBASIC'
     (!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
        ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1344:36: note: in expansion of macro 'RSTRING_LEN'
     if (RB_TYPE_P(x, T_STRING) && (RSTRING_LEN(x)>=1))
                                    ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1082:23: note: in expansion of macro 'R_CAST'
 #define RBASIC(obj)  (R_CAST(RBasic)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:859:14: note: in expansion of macro 'RBASIC'
      (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
              ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:863:6: note: in expansion of macro 'RSTRING_EMBED_LEN'
      RSTRING_EMBED_LEN(str) : \
      ^~~~~~~~~~~~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1344:36: note: in expansion of macro 'RSTRING_LEN'
     if (RB_TYPE_P(x, T_STRING) && (RSTRING_LEN(x)>=1))
                                    ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1086:23: note: in expansion of macro 'R_CAST'
 #define RSTRING(obj) (R_CAST(RString)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:864:6: note: in expansion of macro 'RSTRING'
      RSTRING(str)->as.heap.len)
      ^~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1344:36: note: in expansion of macro 'RSTRING_LEN'
     if (RB_TYPE_P(x, T_STRING) && (RSTRING_LEN(x)>=1))
                                    ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1082:23: note: in expansion of macro 'R_CAST'
 #define RBASIC(obj)  (R_CAST(RBasic)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:866:8: note: in expansion of macro 'RBASIC'
     (!(RBASIC(str)->flags & RSTRING_NOEMBED) ? \
        ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1345:9: note: in expansion of macro 'RSTRING_PTR'
  return RSTRING_PTR(x)[0];
         ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1086:23: note: in expansion of macro 'R_CAST'
 #define RSTRING(obj) (R_CAST(RString)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:867:6: note: in expansion of macro 'RSTRING'
      RSTRING(str)->as.ary : \
      ^~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1345:9: note: in expansion of macro 'RSTRING_PTR'
  return RSTRING_PTR(x)[0];
         ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1086:23: note: in expansion of macro 'R_CAST'
 #define RSTRING(obj) (R_CAST(RString)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:868:6: note: in expansion of macro 'RSTRING'
      RSTRING(str)->as.heap.ptr)
      ^~~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1345:9: note: in expansion of macro 'RSTRING_PTR'
  return RSTRING_PTR(x)[0];
         ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_class_of':
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1081:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define R_CAST(st)   (struct st*)
                      ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1082:23: note: in expansion of macro 'R_CAST'
 #define RBASIC(obj)  (R_CAST(RBasic)(obj))
                       ^~~~~~
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1670:12: note: in expansion of macro 'RBASIC'
     return RBASIC(obj)->klass;
            ^
In file included from C:\Users\Michael\ClionProjects\GetAddresses\main.c:6:0:
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_type':
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:487:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
 #define BUILTIN_TYPE(x) (int)(((struct RBasic*)(x))->flags & T_MASK)
                                ^
C:/Ruby22-x64/include/ruby-2.2.0/ruby/ruby.h:1687:12: note: in expansion of macro 'BUILTIN_TYPE'
     return BUILTIN_TYPE(obj);
            ^
CMakeFiles\GetAddresses.dir\build.make:62: recipe for target 'CMakeFiles/GetAddresses.dir/main.c.obj' failed
mingw32-make.exe[3]: *** [CMakeFiles/GetAddresses.dir/main.c.obj] Error 1
mingw32-make.exe[3]: *** Waiting for unfinished jobs....
C:\Users\Michael\ClionProjects\GetAddresses\GetAdapterInfoHelper.c: In function 'getAddAdapterInfo':
C:\Users\Michael\ClionProjects\GetAddresses\GetAdapterInfoHelper.c:27:9: warning: implicit declaration of function 'asprintf' [-Wimplicit-function-declaration]
         asprintf(*errMSG, "GetAdaptersInfo call failed with: %d", dwRetVal);
         ^~~~~~~~
C:\Users\Michael\ClionProjects\GetAddresses\GetAdaptersAddressHelper.c: In function 'getTargetAdapters':
C:\Users\Michael\ClionProjects\GetAddresses\GetAdaptersAddressHelper.c:101:9: warning: implicit declaration of function 'asprintf' [-Wimplicit-function-declaration]
         asprintf(*errMSG, "Call to GetAdaptersAddresses failed with error: %d", dwRetVal);
         ^~~~~~~~
mingw32-make.exe[2]: *** [CMakeFiles/GetAddresses.dir/all] Error 2
CMakeFiles\Makefile2:66: recipe for target 'CMakeFiles/GetAddresses.dir/all' failed
CMakeFiles\Makefile2:78: recipe for target 'CMakeFiles/GetAddresses.dir/rule' failed
mingw32-make.exe[1]: *** [CMakeFiles/GetAddresses.dir/rule] Error 2
mingw32-make.exe: *** [GetAddresses] Error 2
Makefile:117: recipe for target 'GetAddresses' failed

Michael West

ungelesen,
06.08.2016, 10:39:4106.08.16
an RubyInstaller
So, after digging into this, it appears that the CMAKE find_package does not return the path for the Ruby library so I had to manually assign that.  The only other problem I found so far was that the compiler died when it encountered the typdef for ruby_check_sizeof_voidp.  It was being set to -1 in the conditional, so I changed that to zero.  After those two things, I have it compiling.  Not sure what the long term solution will be.  My hope at this point is that when I move it into the GEM project, rake takes care of this problem.
Allen antworten
Antwort an Autor
Weiterleiten
0 neue Nachrichten