[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Building Windows C Extension

Scott Preston

6/4/2008 7:05:00 PM

All,

I am sure this has been brought up before but I am having problems
writing a simple hello word C extension for Ruby in Windows.

I am able to use nmake to build the library but get:

a C++ popup with R6034 Load Error / (DLL) initialization routine
failed....1.8/i386-msvcrt/mytest.so (LoadError)...

In trying to use MinGW, it does not like the makefile generated by
extconf.rb, and gets hung up on the colon in the topdir. relative
pathing does not work

So I am out of luck on both accounts.

Any help appriciated.

Thanks,
Scott

6 Answers

Jason Roelofs

6/4/2008 7:27:00 PM

0

Building an extension on Windows can be an exercise in frustration.
The biggest problem is that Windows Ruby is still built with VC6 and
thus extensions built with any later technology probably won't work.

The best way I've done it is through Cygwin. There are ways of getting
mingw to work, but it's not pretty and not guarenteed. With the
One-Click Installer, try the following:

CPPFLAGS=-D_MSC_VER=1200 LIBS=-lmsvcp60 ./configure

then see if the compilation will work for you.

Jason

On Wed, Jun 4, 2008 at 3:04 PM, Scott Preston <scotty.preston@gmail.com> wrote:
> All,
>
> I am sure this has been brought up before but I am having problems
> writing a simple hello word C extension for Ruby in Windows.
>
> I am able to use nmake to build the library but get:
>
> a C++ popup with R6034 Load Error / (DLL) initialization routine
> failed....1.8/i386-msvcrt/mytest.so (LoadError)...
>
> In trying to use MinGW, it does not like the makefile generated by
> extconf.rb, and gets hung up on the colon in the topdir. relative
> pathing does not work
>
> So I am out of luck on both accounts.
>
> Any help appriciated.
>
> Thanks,
> Scott
>
>

Roger Pack

6/4/2008 7:52:00 PM

0

post the error message to the one click installer if you'd like help
with mingw :)

> In trying to use MinGW, it does not like the makefile generated by
> extconf.rb, and gets hung up on the colon in the topdir. relative
> pathing does not work
--
Posted via http://www.ruby-....

Scott Preston

6/4/2008 7:52:00 PM

0

Thanks Jason I will give this a try.

Cheers,
Scott

On Wed, Jun 4, 2008 at 3:26 PM, Jason Roelofs <jameskilton@gmail.com> wrote:
> Building an extension on Windows can be an exercise in frustration.
> The biggest problem is that Windows Ruby is still built with VC6 and
> thus extensions built with any later technology probably won't work.
>
> The best way I've done it is through Cygwin. There are ways of getting
> mingw to work, but it's not pretty and not guarenteed. With the
> One-Click Installer, try the following:
>
> CPPFLAGS=-D_MSC_VER=1200 LIBS=-lmsvcp60 ./configure
>
> then see if the compilation will work for you.
>
> Jason
>
> On Wed, Jun 4, 2008 at 3:04 PM, Scott Preston <scotty.preston@gmail.com> wrote:
>> All,
>>
>> I am sure this has been brought up before but I am having problems
>> writing a simple hello word C extension for Ruby in Windows.
>>
>> I am able to use nmake to build the library but get:
>>
>> a C++ popup with R6034 Load Error / (DLL) initialization routine
>> failed....1.8/i386-msvcrt/mytest.so (LoadError)...
>>
>> In trying to use MinGW, it does not like the makefile generated by
>> extconf.rb, and gets hung up on the colon in the topdir. relative
>> pathing does not work
>>
>> So I am out of luck on both accounts.
>>
>> Any help appriciated.
>>
>> Thanks,
>> Scott
>>
>>
>
>

Scott Preston

6/4/2008 8:24:00 PM

0

the error I get from the make via mingw is:

*** target pattern contains no `%'. Stop.

On Wed, Jun 4, 2008 at 3:52 PM, Roger Pack <rogerpack2005@gmail.com> wrote:
> post the error message to the one click installer if you'd like help
> with mingw :)
>
>> In trying to use MinGW, it does not like the makefile generated by
>> extconf.rb, and gets hung up on the colon in the topdir. relative
>> pathing does not work
> --
> Posted via http://www.ruby-....
>
>

Roger Pack

6/4/2008 8:27:00 PM

0

Scott Preston wrote:
> the error I get from the make via mingw is:
>
> *** target pattern contains no `%'. Stop.

for me this means that cygwin's path is before my mingw path. Putting
mingw at the front helped.
GL.
-R
--
Posted via http://www.ruby-....

Scott Preston

6/5/2008 1:14:00 PM

0

I installed an old copy of visual studio 6, compiled my extension with
VC6 and everything worked.

Thanks all for your responses.

Cheers,
Scott

On Wed, Jun 4, 2008 at 4:26 PM, Roger Pack <rogerpack2005@gmail.com> wrote:
> Scott Preston wrote:
>> the error I get from the make via mingw is:
>>
>> *** target pattern contains no `%'. Stop.
>
> for me this means that cygwin's path is before my mingw path. Putting
> mingw at the front helped.
> GL.
> -R
> --
> Posted via http://www.ruby-....
>
>