# Ruby-1.8.6 and 1.8.5 fail to compile under MinGW

**URL:** <https://www.ruby-forum.com/t/ruby-1-8-6-and-1-8-5-fail-to-compile-under-mingw/105254>\
**Category:** Ruby\
**Created:** [May 28, 2007, 5:07am UTC](https://www.ruby-forum.com/t/ruby-1-8-6-and-1-8-5-fail-to-compile-under-mingw/105254 "2007-05-28T05:07:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [May 28, 2007, 5:07am UTC](https://www.ruby-forum.com/t/ruby-1-8-6-and-1-8-5-fail-to-compile-under-mingw/105254/1 "2007-05-28T05:07:41Z")

</div>

Hi,  
I’m trying to build Ruby under MinGW. However after running configure,  
I get some sed errors…

d:\MinGW\bin\sed.exe: -e expression #1, char 2: Extra characters after  
command  
configure: creating ./config.status  
d:\MinGW\bin\sed.exe: -e expression #1, char 2: Extra characters after  
command  
d:\MinGW\bin\sed.exe: -e expression #1, char 2: Extra characters after  
command  
config.status: creating GNUmakefile  
d:\MinGW\bin\sed.exe: -e expression #1, char 2: Extra characters after  
command  
d:\MinGW\bin\sed.exe: -e expression #1, char 2: Extra characters after  
command  
config.status: creating Makefile  
d:\MinGW\bin\sed.exe: -e expression #1, char 2: Extra characters after  
command  
d:\MinGW\bin\sed.exe: -e expression #1, char 2: Extra characters after  
command  
d:\MinGW\bin\sed.exe: -e expression #1, char 2: Extra characters after  
command

which seems to leave some extra junk about cygwin at the end of one of  
the lines in the resulting Makefile.  
MKFILES = Makefile GNUmakefile:cygwin/GNUmakefile.in

make will run if this line is replace by…  
MKFILES = Makefile GNUmakefile

It gets most of the way through then barfs when trying to compile  
readline…

compiling readline  
make[1]: Entering directory `/mingw/SRC/ruby-1.8.6/ext/readline' gcc -I. -I../.. -I../../. -I../.././ext/readline -DHAVE_READLINE_READLINE_H -DHA VE_READLINE_HISTORY_H -DHAVE_RL_FILENAME_COMPLETION_FUNCTION -DHAVE_RL_USERNAME_ COMPLETION_FUNCTION -DHAVE_RL_COMPLETION_MATCHES -DHAVE_RL_DEPREP_TERM_FUNCTION -DHAVE_RL_COMPLETION_APPEND_CHARACTER -DHAVE_RL_BASIC_WORD_BREAK_CHARACTERS -DHA VE_RL_COMPLETER_WORD_BREAK_CHARACTERS -DHAVE_RL_BASIC_QUOTE_CHARACTERS -DHAVE_RL _COMPLETER_QUOTE_CHARACTERS -DHAVE_RL_FILENAME_QUOTE_CHARACTERS -DHAVE_RL_ATTEMP TED_COMPLETION_OVER -DHAVE_RL_LIBRARY_VERSION -DHAVE_RL_EVENT_HOOK -DHAVE_RL_CLE ANUP_AFTER_SIGNAL -DHAVE_RL_CLEAR_SIGNALS -DHAVE_RL_VI_EDITING_MODE -DHAVE_RL_EM ACS_EDITING_MODE -DHAVE_RL_CLEAR_SIGNALS -DHAVE_REPLACE_HISTORY_ENTRY -DHAVE_REM OVE_HISTORY -g -O2 -c readline.c gcc -shared -s -Wl,--enable-auto-image-base,--enable-auto-import,--export-all - L"../.." -o ../../.ext/i386-mingw32/readline.so readline.o -lmsvcrt-ruby18 -lre adline -lwsock32 Cannot export libreadline_NULL_THUNK_DATA: symbol not found nmth000013.o(.idata$4+0x0): undefined reference to`\_nm\_\_rl\_outstream’  
nmth000018.o(.idata$4+0x0): undefined reference to `_nm__rl_instream' nmth000024.o(.idata$4+0x0): undefined reference to`\_nm\_\_rl\_attempted\_completion \_over’  
nmth000026.o(.idata$4+0x0): undefined reference to  
`_nm__rl_completion_append_ch aracter' nmth000031.o(.idata$4+0x0): undefined reference to`\_nm\_\_rl\_basic\_word\_break\_cha racters’  
nmth000034.o(.idata$4+0x0): undefined reference to  
`_nm__rl_completer_word_break _characters' nmth000037.o(.idata$4+0x0): undefined reference to`\_nm\_\_rl\_basic\_quote\_characte rs’  
nmth000040.o(.idata$4+0x0): undefined reference to  
`_nm__rl_completer_quote_char acters' nmth000043.o(.idata$4+0x0): undefined reference to`\_nm\_\_rl\_filename\_quote\_chara cters’  
nmth000046.o(.idata$4+0x0): undefined reference to `_nm__history_base' nmth000049.o(.idata$4+0x0): undefined reference to`\_nm\_\_history\_length’  
nmth000064.o(.idata$4+0x0): undefined reference to  
`_nm__rl_readline_name' nmth000072.o(.idata$4+0x0): undefined reference to`\_nm\_\_rl\_library\_version’  
nmth000074.o(.idata$4+0x0): undefined reference to  
`_nm__rl_attempted_completion _function' nmth000076.o(.idata$4+0x0): undefined reference to`\_nm\_\_rl\_event\_hook’  
collect2: ld returned 1 exit status  
make[1]: \*\*\* […/…/.ext/i386-mingw32/readline.so] Error 1  
make[1]: Leaving directory `/mingw/SRC/ruby-1.8.6/ext/readline’  
make: \*\*\* [all] Error 1

I’m running the crrent latest release version of MinGW. Any suggestions  
on how fix this error?

David
