# "gem install ncurses" on Windows

**URL:** <https://www.ruby-forum.com/t/gem-install-ncurses-on-windows/116637>\
**Category:** Ruby\
**Created:** [October 8, 2007, 10:48am UTC](https://www.ruby-forum.com/t/gem-install-ncurses-on-windows/116637 "2007-10-08T10:48:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rubyrubyruby\_onrail](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@rubyrubyruby\_onrail](https://www.ruby-forum.com/u/rubyrubyruby_onrail)\
**Post date:** [October 8, 2007, 10:48am UTC](https://www.ruby-forum.com/t/gem-install-ncurses-on-windows/116637/1 "2007-10-08T10:48:03Z")

</div>

(This may not be the right place for RubyGem support. If it is not, a  
pointer to the correct location would be nice.)

I am trying to install the ncurses gem on Windows. I installed Ruby  
1.8.6 using the 1-click-installer and have gem 0.9.2.

Simply typing “gem install ncurses” resulted in this error:

> ERROR: Failed to build gem native extension.  
> ruby extconf.rb install ncurses  
>   
> extconf.rb:35: ncurses header file not found (RuntimeError)

So, I downloaded, extracted, and compiled PDCurses 3.3 from  
[http://pdcurses.sourceforge.net/](http://pdcurses.sourceforge.net/) using MSVC 2005 (version 1400 or  
something).

After setting my INCLUDE, LIB, and LIBPATH variables to include the  
PDCurses files, running “gem install ncurses” produces this:

> c:\ruby\lib\ruby\1.8\i386-mswin32\config.h(2) : fatal error C1189: #error : MSC version unmatch

I commented out this error line to see what would happen. I got this:

> nmake
> 
> Microsoft (R) Program Maintenance Utility Version 8.00.50727.42  
> Copyright (C) Microsoft Corporation. All rights reserved.
> 
> cl -nologo -I. -I. -IC:/Ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6 -g -DHAVE\_CURSES\_H -DHAVE\_TABSIZE -DHAVE\_CURSES\_VERSION -DHAVE\_TIGETSTR -DHAVE\_GETWIN -DHAVE\_PUTWIN -DHAVE\_UNGETMOUSE -DHAVE\_MOUSEMASK -DHAVE\_WENCLOSE -DHAVE\_MOUSEINTERVAL -DHAVE\_WMOUSE\_TRAFO -DHAVE\_HAS\_KEY -DHAVE\_DELSCREEN -DHAVE\_USE\_DEFAULT\_COLORS -DHAVE\_WRESIZE -DHAVE\_ATTR\_ON -DHAVE\_ATTR\_OFF -DHAVE\_ATTR\_SET -DHAVE\_CHGAT -DHAVE\_COLOR\_SET -DHAVE\_FILTER -DHAVE\_INTRFLUSH -DHAVE\_MVCHGAT -DHAVE\_MVHLINE -DHAVE\_MVVLINE -DHAVE\_MVWCHGAT -DHAVE\_MVWHLINE -DHAVE\_MVWVLINE -DHAVE\_NOQIFLUSH -DHAVE\_PUTP -DHAVE\_QIFLUSH -DHAVE\_SCR\_DUMP -DHAVE\_SCR\_INIT -DHAVE\_SCR\_RESTORE -DHAVE\_SCR\_SET -DHAVE\_SLK\_ATTR\_OFF -DHAVE\_SLK\_ATTR\_ON -DHAVE\_SLK\_ATTR\_SET -DHAVE\_SLK\_COLOR -DHAVE\_TIGETFLAG -DHAVE\_TIGETNUM -DHAVE\_USE\_ENV -DHAVE\_VIDATTR -DHAVE\_VID\_ATTR -DHAVE\_WATTR\_ON -DHAVE\_WATTR\_OFF -DHAVE\_WATTR\_SET -DHAVE\_WCHGAT -DHAVE\_WCOLOR\_SET -DHAVE\_GETATTRS -DHAVE\_ASSUME\_DEFAULT\_COLORS -DHAVE\_ATTR\_GET -DHAVE\_PANEL\_H -c -Tcform\_wrap.c  
> cl : Command line warning D9035 : option ‘Og-’ has been deprecated and will be removed in a future release  
> cl : Command line warning D9002 : ignoring unknown option ‘-G6’  
> cl : Command line warning D9002 : ignoring unknown option ‘-g’  
> form\_wrap.c  
> cl -nologo -I. -I. -IC:/Ruby/lib/ruby/1.8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6 -g -DHAVE\_CURSES\_H -DHAVE\_TABSIZE -DHAVE\_CURSES\_VERSION -DHAVE\_TIGETSTR -DHAVE\_GETWIN -DHAVE\_PUTWIN -DHAVE\_UNGETMOUSE -DHAVE\_MOUSEMASK -DHAVE\_WENCLOSE -DHAVE\_MOUSEINTERVAL -DHAVE\_WMOUSE\_TRAFO -DHAVE\_HAS\_KEY -DHAVE\_DELSCREEN -DHAVE\_USE\_DEFAULT\_COLORS -DHAVE\_WRESIZE -DHAVE\_ATTR\_ON -DHAVE\_ATTR\_OFF -DHAVE\_ATTR\_SET -DHAVE\_CHGAT -DHAVE\_COLOR\_SET -DHAVE\_FILTER -DHAVE\_INTRFLUSH -DHAVE\_MVCHGAT -DHAVE\_MVHLINE -DHAVE\_MVVLINE -DHAVE\_MVWCHGAT -DHAVE\_MVWHLINE -DHAVE\_MVWVLINE -DHAVE\_NOQIFLUSH -DHAVE\_PUTP -DHAVE\_QIFLUSH -DHAVE\_SCR\_DUMP -DHAVE\_SCR\_INIT -DHAVE\_SCR\_RESTORE -DHAVE\_SCR\_SET -DHAVE\_SLK\_ATTR\_OFF -DHAVE\_SLK\_ATTR\_ON -DHAVE\_SLK\_ATTR\_SET -DHAVE\_SLK\_COLOR -DHAVE\_TIGETFLAG -DHAVE\_TIGETNUM -DHAVE\_USE\_ENV -DHAVE\_VIDATTR -DHAVE\_VID\_ATTR -DHAVE\_WATTR\_ON -DHAVE\_WATTR\_OFF -DHAVE\_WATTR\_SET -DHAVE\_WCHGAT -DHAVE\_WCOLOR\_SET -DHAVE\_GETATTRS -DHAVE\_ASSUME\_DEFAULT\_COLORS -DHAVE\_ATTR\_GET -DHAVE\_PANEL\_H -c -Tcncurses\_wrap.c  
> cl : Command line warning D9035 : option ‘Og-’ has been deprecated and will be removed in a future release  
> cl : Command line warning D9002 : ignoring unknown option ‘-G6’  
> cl : Command line warning D9002 : ignoring unknown option ‘-g’  
> ncurses\_wrap.c  
> C:\Program Files\Microsoft SDKs\Windows\v6.0\Include\wincon.h(101) : warning C4005: ‘MOUSE\_MOVED’ : macro redefinition  
> C:\pdcurses\curses.h(158) : see previous definition of ‘MOUSE\_MOVED’  
> C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\Include\io.h(318) : error C2375: ‘close’ : redefinition; different linkage  
> c:\ruby\lib\ruby\gems\1.8\gems\ncurses-0.9.1\ncurses\_wrap.h(71) : see declaration of ‘close’  
> C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\Include\io.h(320) : error C2375: ‘dup’ : redefinition; different linkage  
> c:\ruby\lib\ruby\gems\1.8\gems\ncurses-0.9.1\ncurses\_wrap.h(70) : see declaration of ‘dup’  
> ncurses\_wrap.c(1267) : warning C4047: ‘function’ : ‘const char \*’ differs in levels of indirection from ‘int’  
> ncurses\_wrap.c(1267) : warning C4024: ‘rb\_str\_new2’ : different types for formal and actual parameter 1  
> ncurses\_wrap.c(2071) : warning C4087: ‘getmouse’ : declared with ‘void’ parameter list  
> NMAKE : fatal error U1077: ‘“C:\Program Files\Microsoft SDKs\Windows\v6.0\VC\Bin\cl.EXE”’ : return code ‘0x2’  
> Stop.

What should I try next? Has anyone successfully installed the ncurses  
gem on Windows? Am I event headed in the right direction?

---

<div class="post-metadata">

**Author:** ![rubyrubyruby\_onrail](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@rubyrubyruby\_onrail](https://www.ruby-forum.com/u/rubyrubyruby_onrail)\
**Post date:** [October 8, 2007, 6:37pm UTC](https://www.ruby-forum.com/t/gem-install-ncurses-on-windows/116637/2 "2007-10-08T18:37:29Z")

</div>

On Oct 8, 2007, at 01:48 , Christopher W, wrote:

> > extconf.rb:35: ncurses header file not found (RuntimeError)
> 
> So, I downloaded, extracted, and compiled PDCurses 3.3 from  
> [http://pdcurses.sourceforge.net/](http://pdcurses.sourceforge.net/) using MSVC 2005 (version 1400 or  
> something).

You’ll need MSVC6 to link correctly. Somebody more familiar with the  
inner workings of Windows compiling will probably pop in and tell you  
why RSN.

---

<div class="post-metadata">

**Author:** ![rubyrubyruby\_onrail](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/7feea3/32.png) [@rubyrubyruby\_onrail](https://www.ruby-forum.com/u/rubyrubyruby_onrail)\
**Post date:** [October 8, 2007, 7:47pm UTC](https://www.ruby-forum.com/t/gem-install-ncurses-on-windows/116637/3 "2007-10-08T19:47:23Z")

</div>

On Oct 8, 10:35 am, Eric H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > ruby extconf.rb install ncurses  
> > >   
> > > extconf.rb:35: ncurses header file not found (RuntimeError)
> 
> > So, I downloaded, extracted, and compiled PDCurses 3.3 from  
> > [http://pdcurses.sourceforge.net/using](http://pdcurses.sourceforge.net/using) MSVC 2005 (version 1400 or  
> > something).
> 
> You’ll need MSVC6 to link correctly. Somebody more familiar with the  
> inner workings of Windows compiling will probably pop in and tell you  
> why RSN.

My guess would be that he needs to pass a “–with-ncurses-dir=C:/path/  
to/ncurses” directive so that the bindings can find the header files  
they need. I can’t remember how you do that with gems. Just tack it on  
at the end?

Regards,

Dan
