# Compile Ruby9i on Windows

**URL:** <https://www.ruby-forum.com/t/compile-ruby9i-on-windows/52462>\
**Category:** Ruby\
**Created:** [January 14, 2006, 5:41pm UTC](https://www.ruby-forum.com/t/compile-ruby9i-on-windows/52462 "2006-01-14T17:41:05Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bertram\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bertram\_S](https://www.ruby-forum.com/u/Bertram_S)\
**Post date:** [January 14, 2006, 5:41pm UTC](https://www.ruby-forum.com/t/compile-ruby9i-on-windows/52462/1 "2006-01-14T17:41:05Z")

</div>

Hi,

in my company we use Oracle and Windows :-(.

Now, I would like at least to start for some quick-and-dirty  
solutions to use Ruby. Maybe my boss could be convinced it’s  
worth a closer look.

I’m afraid, I don’t succeed to compile the  
[http://ruby9i.sourceforge.net/](http://ruby9i.sourceforge.net/) library at all. I get loads  
of errors the more I try. I easily managed to compile my own  
OCI (Oracle from C) programs with MSVC (by the way: C  
plugins, too).

I would build a project file of my own but as I see the Ruby  
installation includes “.so” files. I don’t know what  
restrictions to use to build DLLs that can be renamed to  
that type.

Could anyone please give me a short description of what is  
to do?

Thanks in advance,

Bertram

---

<div class="post-metadata">

**Author:** ![Bertram\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bertram\_S](https://www.ruby-forum.com/u/Bertram_S)\
**Post date:** [January 14, 2006, 8:07pm UTC](https://www.ruby-forum.com/t/compile-ruby9i-on-windows/52462/2 "2006-01-14T20:07:07Z")

</div>

On Sat, 14 Jan 2006 17:38:19 +0100, Bertram S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> of errors the more I try. I easily managed to compile my own
> 
> Thanks in advance,
> 
> Bertram

A .so is a .dll. They’re compiled basically the same way, just remember  
to  
export the Init\_\* functions. (Or for qnd jobs, export all functions, you  
can always optimize later). If you have the time, you might want to give  
the file “rbconfig.rb” a read, pretty much everything the extension  
configuration scripts use is there.

Also, a little bit of POSIX goes a long way. A lot of Makefile  
generators  
count on you using a sh-compatible shell, POSIX CLI tools, and gcc  
compiler flags. You might try switching to a cygwin or mingw build of  
ruby  
if you plan to use extensions a lot.

David V.

---

<div class="post-metadata">

**Author:** ![Bertram\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bertram\_S](https://www.ruby-forum.com/u/Bertram_S)\
**Post date:** [January 16, 2006, 12:48am UTC](https://www.ruby-forum.com/t/compile-ruby9i-on-windows/52462/3 "2006-01-16T00:48:23Z")

</div>

On 1/14/06, Bertram S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> of errors the more I try. I easily managed to compile my own
> 
> Thanks in advance,
> 
> Bertram

I only tried to make Ruby9i work for a short time, before deciding  
that the Ruby-oci8 interface was more recently maintained, and more  
popular:  
[http://www.jiubao.org/ruby-oci8/](http://www.jiubao.org/ruby-oci8/)  
I’m using this (on Windows and otherwise) for a number of production  
tasks and Rails systems, and it works well. Conveniently, it also has  
a binary download for Windows, so you won’t need to compile anything.

---

<div class="post-metadata">

**Author:** ![Bertram\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bertram\_S](https://www.ruby-forum.com/u/Bertram_S)\
**Post date:** [January 16, 2006, 7:20pm UTC](https://www.ruby-forum.com/t/compile-ruby9i-on-windows/52462/4 "2006-01-16T19:20:06Z")

</div>

Hi,

Am Sonntag, 15. Jan 2006, 04:05:56 +0900 schrieb David V.:

> A .so is a .dll. They’re compiled basically the same way, just remember to  
> export the Init\_\* functions. (Or for qnd jobs, export all functions, you  
> can always optimize later). If you have the time, you might want to give  
> the file “rbconfig.rb” a read, pretty much everything the extension  
> configuration scripts use is there.

Phew, I had to edit all the source files and put the  
variable declarations in front of the statements.

Now it compiles and works great. Thank you!

> You might try switching to a cygwin or mingw build of ruby  
> if you plan to use extensions a lot.

That will be the next step …

Bertram

---

<div class="post-metadata">

**Author:** ![Bertram\_S](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/54ee81/32.png) [@Bertram\_S](https://www.ruby-forum.com/u/Bertram_S)\
**Post date:** [January 16, 2006, 8:26pm UTC](https://www.ruby-forum.com/t/compile-ruby9i-on-windows/52462/5 "2006-01-16T20:26:24Z")

</div>

On Mon, 16 Jan 2006 19:19:19 +0100, Bertram S.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > > of errors the more I try. I easily managed to compile my own  
> > > Phew, I had to edit all the source files and put the  
> > > variable declarations in front of the statements.

Oh dear. Someone dared to forget to code in that bleeding-edge  
experimental new shiny C99 .

Arguably the thing I hated most about C. _mutters about Borland Turbo C  
colleges_

> Now it compiles and works great. Thank you!

Hoolay! If that was all that was needed, you’re lucky, I can’t get even  
“nonsense” like iconv and fastcgi to build out of the box.

David V.
