[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

extensions on Windows

Steven Jenkins

4/12/2005 7:31:00 AM

I could use some help from someone who knows Windows.

We use a commercial system engineering tool here at work. It has a C API
that I've wrapped with SWIG and successfully made into an extension on
Linux. The vendor's Linux library is static, but building it into the
Ruby interpreter is straightforward. It works well.

Some of my colleagues would like to use this extension on Windows. I run
Cygwin with Ruby on my Windows machine, but the vendor's DLL was built
with a Microsoft compiler. I played around for a couple of hours with
trying to get gcc to link against a MS DLL and got nowhere, so I
installed the One-Click Ruby for Windows and downloaded MS Visual C++
Toolkit 2003. After another couple of hours, it seemed I needed to also
install something called the Platform SDK. OK, did that, but now it
fails to find MSVCRT.lib when linking.

What am I missing? Is there some simple way to set up an environment
that can compile a single .c file, link against a DLL, and make a shared
object for Ruby?

Any help appreciated.

Steve


10 Answers

Peter Wood

4/12/2005 8:21:00 AM

0

Steve,

I ran into this one as well while using the free compilation tools
from Microsoft. I believe you also have to install the .Net SDK to
get the MSVCRT.lib. Hope that helps.

Peter

>I could use some help from someone who knows Windows.
>
>We use a commercial system engineering tool here at work. It has a C API
>that I've wrapped with SWIG and successfully made into an extension on
>Linux. The vendor's Linux library is static, but building it into the
>Ruby interpreter is straightforward. It works well.
>
>Some of my colleagues would like to use this extension on Windows. I run
>Cygwin with Ruby on my Windows machine, but the vendor's DLL was built
>with a Microsoft compiler. I played around for a couple of hours with
>trying to get gcc to link against a MS DLL and got nowhere, so I
>installed the One-Click Ruby for Windows and downloaded MS Visual C++
>Toolkit 2003. After another couple of hours, it seemed I needed to also
>install something called the Platform SDK. OK, did that, but now it
>fails to find MSVCRT.lib when linking.
>
>What am I missing? Is there some simple way to set up an environment
>that can compile a single .c file, link against a DLL, and make a shared
>object for Ruby?
>
>Any help appreciated.
>
>Steve



Robert Klemme

4/12/2005 11:14:00 AM

0


"Peter Wood" <peter@njini.com> schrieb im Newsbeitrag
news:f06210200be8134c79516@[192.168.252.154]...
> Steve,
>
> I ran into this one as well while using the free compilation tools
> from Microsoft. I believe you also have to install the .Net SDK to
> get the MSVCRT.lib. Hope that helps.

I'm not 100% sure but I think I remember that this lib is part of the OS.
Did you check whether you have that file or MSVCRT.DLL on your machine?

Kind regards

robert

>
> Peter
>
> >I could use some help from someone who knows Windows.
> >
> >We use a commercial system engineering tool here at work. It has a C
API
> >that I've wrapped with SWIG and successfully made into an extension on
> >Linux. The vendor's Linux library is static, but building it into the
> >Ruby interpreter is straightforward. It works well.
> >
> >Some of my colleagues would like to use this extension on Windows. I
run
> >Cygwin with Ruby on my Windows machine, but the vendor's DLL was built
> >with a Microsoft compiler. I played around for a couple of hours with
> >trying to get gcc to link against a MS DLL and got nowhere, so I
> >installed the One-Click Ruby for Windows and downloaded MS Visual C++
> >Toolkit 2003. After another couple of hours, it seemed I needed to also
> >install something called the Platform SDK. OK, did that, but now it
> >fails to find MSVCRT.lib when linking.
> >
> >What am I missing? Is there some simple way to set up an environment
> >that can compile a single .c file, link against a DLL, and make a
shared
> >object for Ruby?
> >
> >Any help appreciated.
> >
> >Steve
>
>
>

Steven Jenkins

4/12/2005 2:30:00 PM

0

Robert Klemme wrote:
>>I ran into this one as well while using the free compilation tools
>>from Microsoft. I believe you also have to install the .Net SDK to
>>get the MSVCRT.lib. Hope that helps.
>
>
> I'm not 100% sure but I think I remember that this lib is part of the OS.
> Did you check whether you have that file or MSVCRT.DLL on your machine?

I have 17 copies of the .dll, but none of the .lib.

The error I get is

LINK : fatal error LNK1104: cannot open file "MSVCRT.LIB'

Can I link against the DLL?

Steve


Robert Klemme

4/12/2005 2:38:00 PM

0


"Steven Jenkins" <steven.jenkins@ieee.org> schrieb im Newsbeitrag
news:425BDB65.7070307@ieee.org...
> Robert Klemme wrote:
> >>I ran into this one as well while using the free compilation tools
> >>from Microsoft. I believe you also have to install the .Net SDK to
> >>get the MSVCRT.lib. Hope that helps.
> >
> >
> > I'm not 100% sure but I think I remember that this lib is part of the
OS.
> > Did you check whether you have that file or MSVCRT.DLL on your
machine?
>
> I have 17 copies of the .dll, but none of the .lib.
>
> The error I get is
>
> LINK : fatal error LNK1104: cannot open file "MSVCRT.LIB'
>
> Can I link against the DLL?

<disclaimer windowsguru="false">I think so.</disclaimer>

robert

Peter Wood

4/12/2005 2:49:00 PM

0

>"Steven Jenkins" <steven.jenkins@ieee.org> schrieb im Newsbeitrag
>news:425BDB65.7070307@ieee.org...
>> Robert Klemme wrote:
>> >>I ran into this one as well while using the free compilation tools
>> >>from Microsoft. I believe you also have to install the .Net SDK to
>> >>get the MSVCRT.lib. Hope that helps.
>> >
>> >
>> > I'm not 100% sure but I think I remember that this lib is part of the
>OS.
>> > Did you check whether you have that file or MSVCRT.DLL on your
>machine?
>>
>> I have 17 copies of the .dll, but none of the .lib.
>>
>> The error I get is
>>
>> LINK : fatal error LNK1104: cannot open file "MSVCRT.LIB'
>>
>> Can I link against the DLL?
>
><disclaimer windowsguru="false">I think so.</disclaimer>
>
> robert

I gave up trying trying to get my extension to compile against a DLL.
If you install the .NET SDK to the default location the msvcrt.lib
file should be in a subdirectory below c:\Program Files\Microsoft
Visual Studio .NET 2003\Vc (probably lib). I know its a pain and a
waste of disk space (if that concerns you) but it worked for me.

Peter


Steven Jenkins

4/12/2005 2:56:00 PM

0

Peter Wood wrote:
> I ran into this one as well while using the free compilation tools from
> Microsoft. I believe you also have to install the .Net SDK to get the
> MSVCRT.lib. Hope that helps.

This is why I feel I don't speak the language of the country I'm in. I
installed Microsoft Visual C++ Toolkit 2003, which presumably would
include the (M)icros(S)oft (V)isual (C) (R)un(T)ime library, but
doesn't. Of course not--it's in the .NET SDK!

But hey, I'll try it. Thanks for the tip.

Steve


ES

4/12/2005 4:21:00 PM

0

Steven Jenkins wrote:
> Robert Klemme wrote:
>
>>>I ran into this one as well while using the free compilation tools
>>
>>>from Microsoft. I believe you also have to install the .Net SDK to
>>
>>>get the MSVCRT.lib. Hope that helps.
>>
>>
>>I'm not 100% sure but I think I remember that this lib is part of the OS.
>>Did you check whether you have that file or MSVCRT.DLL on your machine?
>
>
> I have 17 copies of the .dll, but none of the .lib.
>
> The error I get is
>
> LINK : fatal error LNK1104: cannot open file "MSVCRT.LIB'
>
> Can I link against the DLL?

It is theoretically possible to unwind a DLL into a LIB (you need
to mess with the config) but I was never successful with these
particular files. I would send you mine but I got rid of Windows.

Just download the .Net SDK and throw everything else away :)

> Steve

E



Steven Jenkins

4/12/2005 4:42:00 PM

0

Saynatkari wrote:
> It is theoretically possible to unwind a DLL into a LIB (you need
> to mess with the config) but I was never successful with these
> particular files. I would send you mine but I got rid of Windows.
>
> Just download the .Net SDK and throw everything else away :)

I'm trying. Unfortunately, the MS download site (or my path to it) is
SSSSLLLLOOOOWWWW. The longer it runs, the greater the estimated time
left. Must be using tachyons or something.

Steve


Robert Klemme

4/12/2005 5:57:00 PM

0


"Steven Jenkins" <steven.jenkins@ieee.org> schrieb im Newsbeitrag
news:425BFA5A.9010600@ieee.org...
> Saynatkari wrote:
>> It is theoretically possible to unwind a DLL into a LIB (you need
>> to mess with the config) but I was never successful with these
>> particular files. I would send you mine but I got rid of Windows.
>>
>> Just download the .Net SDK and throw everything else away :)
>
> I'm trying. Unfortunately, the MS download site (or my path to it) is
> SSSSLLLLOOOOWWWW. The longer it runs, the greater the estimated time
> left. Must be using tachyons or something.

Turning your clock around usually fixes such time problems... :-)

robert

Steven Jenkins

4/12/2005 7:25:00 PM

0

Peter Wood wrote:
> I gave up trying trying to get my extension to compile against a DLL. If
> you install the .NET SDK to the default location the msvcrt.lib file
> should be in a subdirectory below c:\Program Files\Microsoft Visual
> Studio .NET 2003\Vc (probably lib). I know its a pain and a waste of
> disk space (if that concerns you) but it worked for me.

I did, and it's right there. Thanks.

Steve