# Problems building Ruby from source on Windows

**URL:** <https://rubytalk.org/t/problems-building-ruby-from-source-on-windows/20728>\
**Category:** ruby-talk\
**Created:** [10 September 2005 17:21 UTC](https://rubytalk.org/t/problems-building-ruby-from-source-on-windows/20728 "2005-09-10T17:21:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Berger2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/daniel_berger2/32/2243_2.png) [@Daniel\_Berger2](https://rubytalk.org/u/Daniel_Berger2)\
**Post date:** [10 September 2005 17:21 UTC](https://rubytalk.org/t/problems-building-ruby-from-source-on-windows/20728/1 "2005-09-10T17:21:31Z")

</div>

Hi all,

Windows XP Pro

C:\ruby\>cl  
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for  
80x86

I'm having trouble building Ruby from source on my Windows box. I've  
tried the latest stable snapshot (Sept. 10, 2005) and 1.8.3p1.

In the case of 1.8.3p1, cl.exe hangs indefinitely trying to build  
parse.c. In the case of the snapshot, it dies with this error during  
nmake:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;cl -nologo -MD -Zi -O2b2xg- -G6 -DRUBY\_EXPORT -I. -I.  
-I./missing -c -Tcdmyext.c  
dmyext.c  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lib -nologo -machine:x86 -out:msvcr71-ruby18-static.lib  
array.obj bignum.obj class.obj compar.obj dir.obj dln.obj  
enum.obj error.obj eval.obj file.obj gc.obj hash.obj inits.obj  
io.obj marshal.obj math.obj numeric.obj object.obj pack.obj  
parse.obj process.obj prec.obj random.obj range.obj re.obj  
regex.obj ruby.obj signal.obj sprintf.obj st.obj string.obj  
struct.obj time.obj util.obj variable.obj version.obj acosh.obj  
crypt.obj erf.obj win32.obj dmyext.obj  
'lib' is not recognized as an internal or external command,  
operable program or batch file.  
NMAKE : fatal error U1077: 'lib' : return code '0x1'

As per the instructions, I ran win32\configure.bat, then nmake. I also  
tried tweaking the prefix, but that made no difference.

What am I doing wrong?

Regards,

Dan

---

<div class="post-metadata">

**Author:** ![Gonzalo\_Garramuno1](https://avatars.discourse-cdn.com/v4/letter/g/e9bcb4/32.png) [@Gonzalo\_Garramuno1](https://rubytalk.org/u/Gonzalo_Garramuno1)\
**Post date:** [10 September 2005 22:21 UTC](https://rubytalk.org/t/problems-building-ruby-from-source-on-windows/20728/2 "2005-09-10T22:21:31Z")

</div>

Not sure about the hanging, but regarding the "lib" error, this points  
to a likely problem in your console environment and/or compiler  
installation.  
lib.exe is a microsoft utility for creating static/dynamic libraries,  
which should be located in the same directory where cl.exe is located.  
When compiling, your PATH variable should be set to point to that  
directory.  
With the microsoft compiler, you usually get a .bat file called  
vcvars32.bat or similar that you can run in a windows console so that  
all the appropiate paths are set for compiling (usually, the microsoft  
compiler does not add its append its path to the global PATH  
environment settings during installation).

---

<div class="post-metadata">

**Author:** ![Daniel\_Berger2](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/daniel_berger2/32/2243_2.png) [@Daniel\_Berger2](https://rubytalk.org/u/Daniel_Berger2)\
**Post date:** [11 September 2005 00:01 UTC](https://rubytalk.org/t/problems-building-ruby-from-source-on-windows/20728/3 "2005-09-11T00:01:30Z")

</div>

gga wrote:

> Not sure about the hanging, but regarding the "lib" error, this points  
> to a likely problem in your console environment and/or compiler  
> installation.  
> lib.exe is a microsoft utility for creating static/dynamic libraries,  
> which should be located in the same directory where cl.exe is located.  
> When compiling, your PATH variable should be set to point to that  
> directory.  
> With the microsoft compiler, you usually get a .bat file called  
> vcvars32.bat or similar that you can run in a windows console so that  
> all the appropiate paths are set for compiling (usually, the microsoft  
> compiler does not add its append its path to the global PATH  
> environment settings during installation).

Thanks, that was it. I ran setenv.bat, but for some odd reason it has  
the lib.exe (and some other files) under bin/win64, and they're only  
added to the path if I run it as "setenv /XP64". I dunno what makes  
lib.exe 64 bit specific.

I think I copied this files up one level on my other system and forgot  
to do that on this one.

Thanks.

Dan
