ruby-debug / debase

BSD 2-Clause "Simplified" License
209 stars 32 forks source link

Can't compile on Windows #10

Closed Ipecac242 closed 10 years ago

Ipecac242 commented 10 years ago

Ruby devkit is installed, but I get this error:

C:\temp>gem install debase
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing debase:
        ERROR: Failed to build gem native extension.

    c:/Dev/Ruby200-p451/bin/ruby.exe extconf.rb
checking for vm_core.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=c:/Dev/Ruby200-p451/bin/ruby
        --with-ruby-dir
        --without-ruby-dir
        --with-ruby-include
        --without-ruby-include=${ruby-dir}/include
        --with-ruby-lib
        --without-ruby-lib=${ruby-dir}/
c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:434:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:565:in `try_cpp'
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:1044:in `block in have_header'
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:895:in `block in checking_for'
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:340:in `block (2 levels) in postpone'
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:310:in `open'
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:340:in `block in postpone'
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:310:in `open'
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:336:in `postpone'
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:894:in `checking_for'
        from c:/Dev/Ruby200-p451/lib/ruby/2.0.0/mkmf.rb:1043:in `have_header'
        from extconf.rb:27:in `block in <main>'
        from c:/Dev/Ruby200-p451/lib/ruby/gems/2.0.0/gems/debugger-ruby_core_source-1.3.2/lib/debugger/ruby_core_source.rb:21:in `call'
        from c:/Dev/Ruby200-p451/lib/ruby/gems/2.0.0/gems/debugger-ruby_core_source-1.3.2/lib/debugger/ruby_core_source.rb:21:in `create_makefile_with_core'
        from extconf.rb:43:in `<main>'

Gem files will remain installed in c:/Dev/Ruby200-p451/lib/ruby/gems/2.0.0/gems/debase-0.0.9 for inspection.

mkmf.log has this:

"gcc -o conftest.exe -Ic:/Dev/Ruby200-p451/include/ruby-2.0.0/i386-mingw32 -Ic:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/backward -Ic:/Dev/Ruby200-p451/include/ruby-2.0.0 -I. -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -Lc:/Dev/Ruby200-p451/lib -L.      -lmsvcrt-ruby200  -lshell32 -lws2_32 -limagehlp -lshlwapi  "
In file included from c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby.h:33:0,
                 from conftest.c:1:
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:125:14: error: size of array 'ruby_check_sizeof_voidp' is negative
In file included from c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby.h:33:0,
                 from conftest.c:1:
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h: In function 'rb_float_value':
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:826:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h: In function 'rb_num2char_inline':
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:1214:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:1214:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:1214:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:1215:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:1215:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:1215:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h: In function 'rb_class_of':
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:1515:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h: In function 'rb_type':
c:/Dev/Ruby200-p451/include/ruby-2.0.0/ruby/ruby.h:1532:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

It appears that gcc doesn't like this line in ruby.h:

typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
os97673 commented 10 years ago

I have Windows 7 64bits I've installed ruby 2.0.0-p451 (32bits) from rubyinstaller.org, applied mingw64-32.4.7.2 devkit and everything works :( What exact ruby and devkit version are you using?

Ipecac242 commented 10 years ago

Per your suggestion, I just tried installing rubyinstaller-2.0.0-p451.exe and DevKit-mingw64-32-4.7.2-20130224-1151-sfx.exe to fresh install folders. Now, it works fine. Not sure what was the problem, maybe some temporary files getting in the way.

Thanks for the help os97673.

os97673 commented 10 years ago

@Ipecac242 you are welcome :)