# Compiler for gems

**URL:** <https://www.ruby-forum.com/t/compiler-for-gems/147479>\
**Category:** Ruby\
**Created:** [September 2, 2008, 11:08am UTC](https://www.ruby-forum.com/t/compiler-for-gems/147479 "2008-09-02T11:08:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hans-dampf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/85e7bf/32.png) [@hans-dampf](https://www.ruby-forum.com/u/hans-dampf)\
**Post date:** [September 2, 2008, 11:08am UTC](https://www.ruby-forum.com/t/compiler-for-gems/147479/1 "2008-09-02T11:08:03Z")

</div>

How can I define, which c-compiler should be used installing gems with  
c-code on windows?  
Is there a possibility to select a compiler (mingw, bcc32, cygwin) or  
does it always use msvc?

---

<div class="post-metadata">

**Author:** ![hans-dampf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/85e7bf/32.png) [@hans-dampf](https://www.ruby-forum.com/u/hans-dampf)\
**Post date:** [September 2, 2008, 2:09pm UTC](https://www.ruby-forum.com/t/compiler-for-gems/147479/2 "2008-09-02T14:09:46Z")

</div>

Hans Dampf wrote:

> How can I define, which c-compiler should be used installing gems with  
> c-code on windows?  
> Is there a possibility to select a compiler (mingw, bcc32, cygwin) or  
> does it always use msvc?

By default it’s the same compiler that you used to compile Ruby.  
Otherwise you could try setting the CC environment variable.

set CC=bcc32

---

<div class="post-metadata">

**Author:** ![hans-dampf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/85e7bf/32.png) [@hans-dampf](https://www.ruby-forum.com/u/hans-dampf)\
**Post date:** [September 3, 2008, 7:26am UTC](https://www.ruby-forum.com/t/compiler-for-gems/147479/3 "2008-09-03T07:26:27Z")

</div>

Hans Dampf wrote:

> How can I define, which c-compiler should be used installing gems with  
> c-code on windows?  
> Is there a possibility to select a compiler (mingw, bcc32, cygwin) or  
> does it always use msvc?

I know that by default with mingw it’ll use what the first “make” and/or  
“gcc” is in the path, so setting the path up right may help.  
-=R
