Building one-click installer compatible C extensions on windows with VS2005

Discussion in 'Ruby' started by Harold Hausman, Apr 27, 2007.

  1. Hi.

    I had an idea for a quick C extension and thought I'd see what it was
    like to build one. I'm pretty familiar with readme.ext as I've done
    some things embedding Ruby recently that have all gone splendidly.

    However, when I tried first to build my new extension using nmake on a
    makefile generated by my extconf.rb I was greeted with lovely errors
    about my MSC_VER being unmatch. :D

    I've read about this before on the various threads that pop up on this
    list from time to time, but just now I think I'm coming to understand
    the pain. I circumvented the various MSC_VER checks, and got my
    extension to build, but unsurprisingly, when I try to require it into
    a script, I see this:

    ---------------------------
    Microsoft Visual C++ Runtime Library
    ---------------------------
    Runtime Error!

    Program: c:\ruby\bin\ruby.exe

    R6034

    An application has made an attempt to load the C runtime library incorrectly.
    Please contact the application's support team for more information.


    ---------------------------
    OK
    ---------------------------

    Yay!

    So I can only imagine that the maintainers of the one-click installer
    are very happy with their current setup, and I can't really blame
    them, it's pretty rad and has worked perfectly for me up until this
    point. :)

    Various googling and reading hasn't really given me the info I need,
    so I have a couple quick questions.

    If the one-click installer did happen to be built with 2005, would I
    be having this problem?

    And, what should I do? Is it possible to build one-click-installer
    compatible C extensions with VS2005? Or do I need to switch to cygwin
    or MingGW, if so witch?

    A million thanks for your time,
    -Harold
    Harold Hausman, Apr 27, 2007
    #1
    1. Advertising

  2. Harold Hausman

    Jano Svitok Guest

    On 4/27/07, Harold Hausman <> wrote:
    > Hi.
    >
    > I had an idea for a quick C extension and thought I'd see what it was
    > like to build one. I'm pretty familiar with readme.ext as I've done
    > some things embedding Ruby recently that have all gone splendidly.
    >
    > However, when I tried first to build my new extension using nmake on a
    > makefile generated by my extconf.rb I was greeted with lovely errors
    > about my MSC_VER being unmatch. :D
    >
    > I've read about this before on the various threads that pop up on this
    > list from time to time, but just now I think I'm coming to understand
    > the pain. I circumvented the various MSC_VER checks, and got my
    > extension to build, but unsurprisingly, when I try to require it into
    > a script, I see this:
    >
    > ---------------------------
    > Microsoft Visual C++ Runtime Library
    > ---------------------------
    > Runtime Error!
    >
    > Program: c:\ruby\bin\ruby.exe
    >
    > R6034
    >
    > An application has made an attempt to load the C runtime library incorrectly.
    > Please contact the application's support team for more information.
    >
    >
    > ---------------------------
    > OK
    > ---------------------------
    >
    > Yay!
    >
    > So I can only imagine that the maintainers of the one-click installer
    > are very happy with their current setup, and I can't really blame
    > them, it's pretty rad and has worked perfectly for me up until this
    > point. :)
    >
    > Various googling and reading hasn't really given me the info I need,
    > so I have a couple quick questions.
    >
    > If the one-click installer did happen to be built with 2005, would I
    > be having this problem?
    >
    > And, what should I do? Is it possible to build one-click-installer
    > compatible C extensions with VS2005? Or do I need to switch to cygwin
    > or MingGW, if so witch?
    >
    > A million thanks for your time,
    > -Harold


    Hi,

    1. Ruby 1.8.6. should be compilable by VS2005. The one-click installer
    recompilation is not that hard... for me it was something about three
    hours to get it built (learning and fixing included). Just read the
    readme's and howto's for ruby and oci. I had to manually download
    sources for some of the bundled-in extensions.

    2. If you compile ruby with VS2005 you have to compile all the
    extensions with it, so binary gems from rubyforge won't be for you.

    3. The standard one-click is compiled with VS6, and so are all the
    binary gems on rubyforge. If you want to be compatible, you can use
    either VS6 or mingw. cygwin is different.

    4. You might be lucky and build VS2005 extension that works with VS6
    ruby, but you have to avoid some functions. I won't tell you which, I
    suspect they are those dealing with files, and errno, and... ;-)
    AFAIK, the problem is in incompatible msvcrtXX.dll.

    Jano
    Jano Svitok, Apr 27, 2007
    #2
    1. Advertising

  3. Harold Hausman

    bbiker Guest

    On Apr 27, 11:21 am, "Jano Svitok" <> wrote:
    > On 4/27/07, Harold Hausman <> wrote:
    >
    >
    >
    >
    >
    > > Hi.

    >
    > > I had an idea for a quick C extension and thought I'd see what it was
    > > like to build one. I'm pretty familiar with readme.ext as I've done
    > > some things embedding Ruby recently that have all gone splendidly.

    >
    > > However, when I tried first to build my new extension using nmake on a
    > > makefile generated by my extconf.rb I was greeted with lovely errors
    > > about my MSC_VER being unmatch. :D

    >
    > > I've read about this before on the various threads that pop up on this
    > > list from time to time, but just now I think I'm coming to understand
    > > the pain. I circumvented the various MSC_VER checks, and got my
    > > extension to build, but unsurprisingly, when I try to require it into
    > > a script, I see this:

    >
    > > ---------------------------
    > > Microsoft Visual C++ Runtime Library
    > > ---------------------------
    > > Runtime Error!

    >
    > > Program: c:\ruby\bin\ruby.exe

    >
    > > R6034

    >
    > > An application has made an attempt to load the C runtime library incorrectly.
    > > Please contact the application's support team for more information.

    >
    > > ---------------------------
    > > OK
    > > ---------------------------

    >
    > > Yay!

    >
    > > So I can only imagine that the maintainers of the one-click installer
    > > are very happy with their current setup, and I can't really blame
    > > them, it's pretty rad and has worked perfectly for me up until this
    > > point. :)

    >
    > > Various googling and reading hasn't really given me the info I need,
    > > so I have a couple quick questions.

    >
    > > If the one-click installer did happen to be built with 2005, would I
    > > be having this problem?

    >
    > > And, what should I do? Is it possible to build one-click-installer
    > > compatible C extensions with VS2005? Or do I need to switch to cygwin
    > > or MingGW, if so witch?

    >
    > > A million thanks for your time,
    > > -Harold

    >
    > Hi,
    >
    > 1. Ruby 1.8.6. should be compilable by VS2005. The one-click installer
    > recompilation is not that hard... for me it was something about three
    > hours to get it built (learning and fixing included). Just read the
    > readme's and howto's for ruby and oci. I had to manually download
    > sources for some of the bundled-in extensions.
    >
    > 2. If you compile ruby with VS2005 you have to compile all the
    > extensions with it, so binary gems from rubyforge won't be for you.
    >
    > 3. The standard one-click is compiled with VS6, and so are all the
    > binary gems on rubyforge. If you want to be compatible, you can use
    > either VS6 or mingw. cygwin is different.
    >
    > 4. You might be lucky and build VS2005 extension that works with VS6
    > ruby, but you have to avoid some functions. I won't tell you which, I
    > suspect they are those dealing with files, and errno, and... ;-)
    > AFAIK, the problem is in incompatible msvcrtXX.dll.
    >
    > Jano- Hide quoted text -
    >
    > - Show quoted text -


    VS6 is no longer available from Microsoft ... so where can someone
    obtain it?

    Please, excuse newbie question.

    Are you saying that mingw can compile code compatible with mswin32?

    Thanks

    bbiker
    bbiker, Apr 27, 2007
    #3
  4. Harold Hausman

    Jano Svitok Guest

    On 4/27/07, bbiker <> wrote:
    > On Apr 27, 11:21 am, "Jano Svitok" <> wrote:
    > > On 4/27/07, Harold Hausman <> wrote:
    > >
    > >
    > >
    > >
    > >
    > > > Hi.

    > >
    > > > I had an idea for a quick C extension and thought I'd see what it was
    > > > like to build one. I'm pretty familiar with readme.ext as I've done
    > > > some things embedding Ruby recently that have all gone splendidly.

    > >
    > > > However, when I tried first to build my new extension using nmake on a
    > > > makefile generated by my extconf.rb I was greeted with lovely errors
    > > > about my MSC_VER being unmatch. :D

    > >
    > > > I've read about this before on the various threads that pop up on this
    > > > list from time to time, but just now I think I'm coming to understand
    > > > the pain. I circumvented the various MSC_VER checks, and got my
    > > > extension to build, but unsurprisingly, when I try to require it into
    > > > a script, I see this:

    > >
    > > > ---------------------------
    > > > Microsoft Visual C++ Runtime Library
    > > > ---------------------------
    > > > Runtime Error!

    > >
    > > > Program: c:\ruby\bin\ruby.exe

    > >
    > > > R6034

    > >
    > > > An application has made an attempt to load the C runtime library incorrectly.
    > > > Please contact the application's support team for more information.

    > >
    > > > ---------------------------
    > > > OK
    > > > ---------------------------

    > >
    > > > Yay!

    > >
    > > > So I can only imagine that the maintainers of the one-click installer
    > > > are very happy with their current setup, and I can't really blame
    > > > them, it's pretty rad and has worked perfectly for me up until this
    > > > point. :)

    > >
    > > > Various googling and reading hasn't really given me the info I need,
    > > > so I have a couple quick questions.

    > >
    > > > If the one-click installer did happen to be built with 2005, would I
    > > > be having this problem?

    > >
    > > > And, what should I do? Is it possible to build one-click-installer
    > > > compatible C extensions with VS2005? Or do I need to switch to cygwin
    > > > or MingGW, if so witch?

    > >
    > > > A million thanks for your time,
    > > > -Harold

    > >
    > > Hi,
    > >
    > > 1. Ruby 1.8.6. should be compilable by VS2005. The one-click installer
    > > recompilation is not that hard... for me it was something about three
    > > hours to get it built (learning and fixing included). Just read the
    > > readme's and howto's for ruby and oci. I had to manually download
    > > sources for some of the bundled-in extensions.
    > >
    > > 2. If you compile ruby with VS2005 you have to compile all the
    > > extensions with it, so binary gems from rubyforge won't be for you.
    > >
    > > 3. The standard one-click is compiled with VS6, and so are all the
    > > binary gems on rubyforge. If you want to be compatible, you can use
    > > either VS6 or mingw. cygwin is different.
    > >
    > > 4. You might be lucky and build VS2005 extension that works with VS6
    > > ruby, but you have to avoid some functions. I won't tell you which, I
    > > suspect they are those dealing with files, and errno, and... ;-)
    > > AFAIK, the problem is in incompatible msvcrtXX.dll.
    > >
    > > Jano- Hide quoted text -
    > >
    > > - Show quoted text -

    >
    > VS6 is no longer available from Microsoft ... so where can someone
    > obtain it?
    >
    > Please, excuse newbie question.
    >
    > Are you saying that mingw can compile code compatible with mswin32?
    >
    > Thanks
    >
    > bbiker


    VS6 is not officially available - due to java settlement with sun (the
    java version bundled with VS6 was not compliant) - the install files
    are on MSDN CDs/DVDs, but you cannot obtain new keys. So you need to
    find an old key.

    Mingw is binary compatible with VS6 (or, that is what was written here
    by other people)
    Jano Svitok, Apr 27, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. timw.google
    Replies:
    1
    Views:
    531
    Serge Orlov
    May 11, 2006
  2. Curt Hibbs
    Replies:
    6
    Views:
    162
  3. Curt Hibbs
    Replies:
    2
    Views:
    81
    Curt Hibbs
    Aug 17, 2004
  4. J. D.
    Replies:
    8
    Views:
    128
    Curt Hibbs
    Nov 10, 2004
  5. pantagruel
    Replies:
    0
    Views:
    240
    pantagruel
    Feb 17, 2006
Loading...

Share This Page