msys2 / MSYS2-packages

Package scripts for MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
1.28k stars 485 forks source link

gem install ncurses #131

Open Konfekt opened 9 years ago

Konfekt commented 9 years ago

ruby and devtools are installed, however gem install ncurses gives

Building native extensions.  This could take a while...
ERROR:  Error installing ncurses:
        ERROR: Failed to build gem native extension.

    /usr/bin/ruby.exe extconf.rb
checking for unistd.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=/usr/bin/ruby
/usr/lib/ruby/2.1.0/mkmf.rb:457:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
        from /usr/lib/ruby/2.1.0/mkmf.rb:588:in `try_cpp'
        from /usr/lib/ruby/2.1.0/mkmf.rb:1068:in `block in have_header'
        from /usr/lib/ruby/2.1.0/mkmf.rb:919:in `block in checking_for'
        from /usr/lib/ruby/2.1.0/mkmf.rb:352:in `block (2 levels) in postpone'
        from /usr/lib/ruby/2.1.0/mkmf.rb:322:in `open'
        from /usr/lib/ruby/2.1.0/mkmf.rb:352:in `block in postpone'
        from /usr/lib/ruby/2.1.0/mkmf.rb:322:in `open'
        from /usr/lib/ruby/2.1.0/mkmf.rb:348:in `postpone'
        from /usr/lib/ruby/2.1.0/mkmf.rb:918:in `checking_for'
        from /usr/lib/ruby/2.1.0/mkmf.rb:1067:in `have_header'
        from extconf.rb:27:in `<main>'

extconf failed, exit code 1
Alexpux commented 9 years ago

I'm not familiar with ruby. Seems you try to use msys-ruby and build can't find system headers. I think you need install: pacman -S msys2-runtime-devel ncurses-devel gcc

Konfekt commented 9 years ago

Thank you. I tried that and restarted msy2. The issue persists. There's also a warning

WARNING:  You don't have /c/Users/Konfekt/.gem/ruby/2.1.0/bin in your PATH,
          gem executables will not run.

which is true, as there are no binaries in that folder, but I think this only affects running these programs. I have also ruby windows native installed, but removing it from PATH didn't change anything.

elieux commented 9 years ago

You're probably still missing some packages. Unfortunately, my results aren't so good either:

gcc -shared -o ncurses.so form_wrap.o ncurses_wrap.o panel_wrap.o -L. -L/usr/lib -L. -pipe -fstack-protector -Wl,--export-all-symbols -Wl,--enable-auto-image-base,--enable-auto-import    -lruby210 -lncurses  -lpthread -lgmp -ldl -lcrypt
ncurses_wrap.o: In function `rbncurs_insstr':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:902: undefined reference to `STR2CSTR'
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:902:(.text+0x2b8): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o: In function `rbncurs_addstr':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:539: undefined reference to `STR2CSTR'
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:539:(.text+0x7a8): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o: In function `rbncurs_tigetstr':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1267: undefined reference to `STR2CSTR'
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1267:(.text+0x9d8): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o: In function `rbncurs_tigetnum':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1262: undefined reference to `STR2CSTR'
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1262:(.text+0x9f8): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o: In function `rbncurs_tigetflag':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1257: undefined reference to `STR2CSTR'
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1257:(.text+0xa18): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o:/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1178: more undefined references to `STR2CSTR' follow
ncurses_wrap.o: In function `rbncurs_scr_set':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1178:(.text+0xc48): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o: In function `rbncurs_scr_restore':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1173:(.text+0xc68): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o: In function `rbncurs_scr_init':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1159:(.text+0xc88): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o: In function `rbncurs_scr_dump':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1154:(.text+0xca8): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o: In function `rbncurs_putp':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:1121:(.text+0xd88): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `STR2CSTR'
ncurses_wrap.o: In function `rbncurs_define_key':
/c/Users/ether/.gem/ruby/2.1.0/gems/ncurses-0.9.1/ncurses_wrap.c:430:(.text+0x22c5): additional relocation overflows omitted from the output
collect2: error: ld returned 1 exit status

full log