Compiling Extensions on Windows

J

Jim Weirich

I need to compile some ruby extensions on a windows box. Although I've
done this on Linux hundreds of times, I'm not setup for developement on
the windows box nor am I very familiar with windows development. What do
I need on windows to build ruby C extensions that are compatible with the
one click installer?

Thanks.
 
J

Joel VanderWerf

Jim said:
I need to compile some ruby extensions on a windows box. Although I've
done this on Linux hundreds of times, I'm not setup for developement on
the windows box nor am I very familiar with windows development. What do
I need on windows to build ruby C extensions that are compatible with the
one click installer?

Thanks.

You can install MSVC:

http://msdn.microsoft.com/visualc/vctoolkit2003/

and then:

- run extconf.rb as usual, and

- use nmake instead of make.

Or you can use mingw, if you prefer (or demand) gcc. I've found mingw
output to be compatible with the one-click ruby.
 
J

Joey Gibson

Joel said:


Have you actually gotten that to work? I tried building some stuff with
that compiler when it came out, but because they got rid of the 'lib'
program, the build failed. Maybe they've added it back in or changed
things, but I had to drop back to MSVC6 to get ruby stuff to compile.


--
She drove a Plymouth Satellite
Faster than the Speed of Light...

http://www.joeygibson.com/blog
http://www.joeygibson.com/blog/life/Wisdom.html
Atlanta Ruby User Group http://www.AtlRUG.org
 
J

Joel VanderWerf

Joey said:
Have you actually gotten that to work? I tried building some stuff with
that compiler when it came out, but because they got rid of the 'lib'
program, the build failed. Maybe they've added it back in or changed
things, but I had to drop back to MSVC6 to get ruby stuff to compile.

It worked for the few extensions I built. Can't remember now which
ones... I'll check next time I boot into windows.

Which ones did you try?
 
C

Curt Hibbs

Joel said:
You can install MSVC:

http://msdn.microsoft.com/visualc/vctoolkit2003/

and then:

- run extconf.rb as usual, and

- use nmake instead of make.

Or you can use mingw, if you prefer (or demand) gcc. I've found mingw
output to be compatible with the one-click ruby.

I am probably wrong here, so please correct me...

I seem to recall trying out this free msvc toolkit about 6 to 9 months ago,
and after I installed it I couldn't find nmake anywhere. The compiler would
be pretty useless without nmake, so someone please tell me that I did
something wrong.

Curt
 
S

Shashank Date

--- Curt Hibbs said:
I seem to recall trying out this free msvc toolkit
about 6 to 9 months ago,
and after I installed it I couldn't find nmake
anywhere. The compiler would
be pretty useless without nmake, so someone please
tell me that I did
something wrong.

You downloaded only the toolkit. You should also
download the FrameWork SDK (free ;-)

http://msdn.microsoft.com/netframework/downloads/framework1_1/#section3

I have downloaded both and nmake is there, under:

------
C:\Program Files\Microsoft.NET>dir nmake*.* /s
Volume in drive C is LOCAL
Volume Serial Number is AC53-D8CC

Directory of C:\Program
Files\Microsoft.NET\SDK\v1.1\Bin

03/18/2003 08:38p 81,920 nmake.exe
1 File(s) 81,920 bytes

C:\Program Files\Microsoft.NET>
-----

-- shanko



_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
 
C

Curt Hibbs

Shashank said:
You downloaded only the toolkit. You should also
download the FrameWork SDK (free ;-)

http://msdn.microsoft.com/netframework/downloads/framework1_1/#section3

Thanks, I knew I must have missed something!

Even though I have the paid version of vc++ I would prefer to compile the
one-click installer with a version that is free to everyone. I'll give this
a try and update the read-me instructions for those who want to build the
installer themselves.

Curt
 
J

Justin Rudd

I've used both MinGW and Visual Studio.NET 7.1 (or 2003) successfully.
I tend to use Visual Studio.NET more than MinGW. Mainly because of
familiarity. I haven't tried the VC++ Express edition that you can
get for free from MS. But it should work because it comes with full
headers to CRT, STL, etc.

There are a couple of other suggestions about using the Framework SDK.
This is the .NET Framework. And while it does come with cl, link,
and nmake. It comes with a bare minimum of header files. And the
header files it does come with are mostly for integrating with .NET.
There is no STL or CRT. So it might not work out of the box building
Ruby (or other extensions).

Also there is a link to NMAKE 1.5. This is the 16 bit NMAKE. I
wouldn't recommend trying to use it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top