Building ruby on windows 7

I’m trying to build ruby 1.9.2 rc2 on windows 7. When I run
configure.bat it aborts with the following message.
cl -nologo -MD rtname.c user32.lib -link > nul
NMAKE : fatal error U1077: ‘cl’ : return code ‘0x2’
Stop.

I find that the file ‘rtname.c’ does not exist anywhere within the
source files. And this is why cl aborts.

I’m totally clueless as to what to do next. Searching for rtname.c on
google doesn’t return anything.

On Tue, Aug 10, 2010 at 09:13:48PM +0900, Manohar A. wrote:

google doesn’t return anything.

Posted via http://www.ruby-forum.com/.

Were you using http://rubyforge.org/frs/?group_id=167 ?

macrolet wrote:

On Tue, Aug 10, 2010 at 09:13:48PM +0900, Manohar A. wrote:

google doesn’t return anything.

Posted via http://www.ruby-forum.com/.

Were you using http://rubyforge.org/frs/?group_id=167 ?

No, I used the source present here.
http://www.ruby-lang.org/en/news/2010/07/11/ruby-1-9-2-rc2-is-released

Hi *,

I’m also using Win7 to compile Ruby Trunk. Together with VC++ (CL
Version 16) it produces exactly the same problem as described by Manohar
Akula. Has anyone successfully compiled trunk with this setup or is this
setup not supported by the current build scripts? In this case what is
the latest version which is still working together with the mswin build
env or is this target deprecated?

Regards
Daniel

On Aug 10, 9:13 am, Manohar A. [email protected] wrote:

google doesn’t return anything.
If compilers are not your ground of expertise, I would suggest you
skip that and use a pre-compiled binary.

You can find 1.9.2-rc2 available under the experimental section of
RubyInstaller project at RubyForge:

http://rubyforge.org/projects/rubyinstaller/

All these versions are compiled using GCC (MinGW) and work under 32
and 64bits OS.

You can build yourself from source also, using RubyInstaller building
recipes:

http://github.com/oneclick/rubyinstaller/

Only pre-requisite is a working Ruby installation, which, ehem, you
can use again Ruby 1.8.7 or something from RubyInstaller download
page:

http://rubyinstaller.org/downloads

If you still want to play with Visual Studio, I would suggest you try
a checkout of ruby_1_9_2 branch since some MSVC issues has been fixed
since rc2

HTH,

Hi,

2010/10/28 Daniel B. [email protected]:

Hi *,

I’m also using Win7 to compile Ruby Trunk. Together with VC++ (CL
Version 16) it produces exactly the same problem as described by Manohar
Akula. Has anyone successfully compiled trunk with this setup or is this
setup not supported by the current build scripts? In this case what is
the latest version which is still working together with the mswin build
env or is this target deprecated?

I guess you mean the following message:

cl -nologo -MD rtname.c user32.lib -link > nul
NMAKE : fatal error U1077: ‘cl’ : return code ‘0x2’
Stop.

The error means that you did not install Platform SDK.
You must install Microsoft Windows SDK for Windows 7 and .NET Framework
4.
Refer to http://en.wikipedia.org/wiki/Microsoft_Windows_SDK

Regards,
Park H.

Hi Hessob,

Thank you so much for your fast reply!

Heesob P. wrote in post #957790:

I guess you mean the following message:

cl -nologo -MD rtname.c user32.lib -link > nul
NMAKE : fatal error U1077: ‘cl’ : return code ‘0x2’
Stop.

The error means that you did not install Platform SDK.
You must install Microsoft Windows SDK for Windows 7 and .NET Framework
4.
Refer to http://en.wikipedia.org/wiki/Microsoft_Windows_SDK

Actually I already have put all these SDKs in place and set the correct
Lib, Include and Path Environment Variables. After trying to understand
the build process of win32 a little bit, I found that there is something
strange with win32\setup.mak

In line 79 there is the following line:
$(CC) -MD <<rtname.c user32.lib -link > nul

After removing the redirect “> nul” it immediately compiled everything
and even the test-all target was execute with only minor problems
(around 49 fails). Rubyspec is actually hanging at the Kernel.spawn task
but this is another thing.

I have to admit I’m still not complete understand the behavior, I expect
this was just a symptom but not the real reason, cause otherwise this
would be fixed a long time ago.

I’m quite confident that all the things (cl, bison, sed, libs and
includes) are in place but something has to be wrong with my setup due
to the reason that I can’t even configure the trunk without patching
setup.mak. Any clue everyone? Is actually someone using win32 or is
mingw32 the way everyone else is going?

Thanks for any feedback!

Regards
Daniel

Hi,

2010/11/2 Daniel B. [email protected]:

In line 79 there is the following line:

I’m quite confident that all the things (cl, bison, sed, libs and
includes) are in place but something has to be wrong with my setup due
to the reason that I can’t even configure the trunk without patching
setup.mak. Any clue everyone? Is actually someone using win32 or is
mingw32 the way everyone else is going?

Without > nul
C:\work\snapshot>win32\configure.bat
cl -nologo -MD rtname.c user32.lib -link
rtname.c
Checking unicows.lib
Creating Makefile.new
“type `nmake’ to make ruby.”

With > nul
C:\work\snapshot>win32\configure.bat
cl -nologo -MD rtname.c user32.lib -link > nul
Checking unicows.lib
Creating Makefile.new
“type `nmake’ to make ruby.”

With >x nul
C:\work\snapshot>win32\configure.bat
cl -nologo -MD rtname.c user32.lib -link >x nul
NMAKE : fatal error U1077: ‘cl’ : return code ‘0x2’
Stop.

I guess in your environment, the “>” redirection operator means
something else.
What is the outoupt of “dir > nul”?

Regards,
Park H.

Hi Park,

due to the reason that something was really wrong with my environment I
just dropped the complete trunk and got a fresh one (the clean make
target
doesn’t seem to be sufficient). After checking out the the fresh one,
removing all the env variables and set it manually on the command line
it
compiles now without any trouble. The “> nul” was an absolute false clue
from me but was kind of reproducible (-: stupid_me

I apologies for the noise! It seems you were absolute right. Taking a
really good look at the env variables solved all the build issues (-;

The env settings were now:

set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\bin;C:\Program Files (x86)\Microsoft Visual Studio
10.0\Common7\IDE;C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Bin;C:\GnuWin32\bin\

set INCLUDE=%INCLUDE%;C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Include;C:\Program Files (x86)\Microsoft Visual
Studio 10.0\VC\include

set LIB=%LIB%;C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Lib;C:\Program Files (x86)\Microsoft Visual Studio
10.0\VC\lib

And afterwards there is no complain from any build script (-:

Thanks again Park for your great help!

Regards
Daniel

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs