# Msvcr\*.dll

**URL:** <https://www.ruby-forum.com/t/msvcr-dll/108097>\
**Category:** Ruby\
**Created:** [June 29, 2007, 12:48am UTC](https://www.ruby-forum.com/t/msvcr-dll/108097 "2007-06-29T00:48:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Morris\_Brodersen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@Morris\_Brodersen](https://www.ruby-forum.com/u/Morris_Brodersen)\
**Post date:** [June 29, 2007, 12:48am UTC](https://www.ruby-forum.com/t/msvcr-dll/108097/1 "2007-06-29T00:48:12Z")

</div>

hi,

i’m trying to build a ruby extension in c on windows, using mingw32’s  
gcc.

these are the two compile commands i use:

gcc -o tga.o tga.c -c -I c:/ruby/lib/ruby/1.8/i386-mswin32  
gcc -shared -o tga.so tga.o  
-Wl,c:/ruby/bin/msvcrt-ruby18.dll,c:/windows/system32/msvcrt.dll

everything compiles, with a few warnings, but tga.so is created. it has  
also a valid Init\_tga() function, because otherwise is just get “could  
not find Init\_tga()”.

however, when i try to require tga.so, i get an error that “msvcr80.dll”  
is missing. my question is: how did the compiler link to that dll  
anyway? i didnt mention it. anyways i’d like to know how to fix this  
problem.

by the way, its the one-click-installer of ruby 1.8.6 and windows xp  
home

-morris

---

<div class="post-metadata">

**Author:** ![Morris\_Brodersen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@Morris\_Brodersen](https://www.ruby-forum.com/u/Morris_Brodersen)\
**Post date:** [June 29, 2007, 10:02am UTC](https://www.ruby-forum.com/t/msvcr-dll/108097/2 "2007-06-29T10:02:06Z")

</div>

Morris Brodersen wrote:

> however, when i try to require tga.so, i get an error that “msvcr80.dll”  
> is missing.  
> i downloaded the msvcr80.dll somewhere and moved it into c:/windows.  
> this didnt fix the problem, i now get a runtime error “application is  
> trying to initialize a library incorrectly”.

btw, should i post this topic somewhere else? im new to ruby-forum. dont  
know wether its the right category.

---

<div class="post-metadata">

**Author:** ![Morris\_Brodersen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@Morris\_Brodersen](https://www.ruby-forum.com/u/Morris_Brodersen)\
**Post date:** [July 1, 2007, 11:22am UTC](https://www.ruby-forum.com/t/msvcr-dll/108097/3 "2007-07-01T11:22:28Z")

</div>

could it be that something in ruby.h is calling some function of any  
msvcr\*.dll?

---

<div class="post-metadata">

**Author:** ![Morris\_Brodersen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/8c91f0/32.png) [@Morris\_Brodersen](https://www.ruby-forum.com/u/Morris_Brodersen)\
**Post date:** [July 2, 2007, 2:42pm UTC](https://www.ruby-forum.com/t/msvcr-dll/108097/4 "2007-07-02T14:42:12Z")

</div>

well, i kind of fixed that problem… seems like the only thing i had to  
do is to put tga.so into c:/ruby/lib/ruby/site\_ruby/1.8/i386-msvcrt/. it  
just works.

if somebody knows why this is happening i’d be very grateful 🙂 because  
i have other .so’s which are definitely not in there but work.

-morris
