# Problems Building on Windows

**URL:** <https://www.ruby-forum.com/t/problems-building-on-windows/201529>\
**Category:** Ruby-Gnome 2\
**Created:** [January 10, 2011, 11:52am UTC](https://www.ruby-forum.com/t/problems-building-on-windows/201529 "2011-01-10T11:52:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 10, 2011, 11:52am UTC](https://www.ruby-forum.com/t/problems-building-on-windows/201529/1 "2011-01-10T11:52:41Z")

</div>

I am having a huge amount of problems building this on windows.  
I admit that I am not following the directions on the website  
because I would like to have something newer than 2.10.  
I got the 2.22 bundle from [gtk.org](http://gtk.org). Maybe it’s not supported?

Anyway, my first problem was that I needed to set the  
PKG\_CONFIG\_PATH environment variable so that ruby-gnome2  
could find my GTK installation. It took me a long time to  
figure that out, so it would be nice to have a note in the  
documentation.

But then I ran into the problem that the mkmf-gnome2.rb  
script doesn’t set the CFLAGS from pkg-config. I’m not  
sure why because Kou’s pkg-config script makes it quite  
easy.

But then finally, some GTK variables can’t be found.  
It seems like 2.22 isn’t supported yet. But I can’t find  
anything on the website saying what version _is_ supported.  
I don’t believe it is 2.10 because that is more than 2  
years old.

I would really, really like to build this so I can finally  
release my application on windows. Any help is  
appreciated.

```
MikeC

```

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [January 10, 2011, 1:30pm UTC](https://www.ruby-forum.com/t/problems-building-on-windows/201529/2 "2011-01-10T13:30:54Z")

</div>

Hi,

In [AANLkTimV=HZpe\_o-aE7KcMf\_XzfPA=removed\_email\_address@domain.invalid](mailto:AANLkTimV=HZpe_o-aE7KcMf_XzfPA=removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] Problems Building on Windows” on Mon, 10 Jan  
2011 19:51:49 +0900,  
Mike C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am having a huge amount of problems building this on windows.  
> I admit that I am not following the directions on the website  
> because I would like to have something newer than 2.10.  
> I got the 2.22 bundle from [gtk.org](http://gtk.org). Maybe it’s not supported?

GTK+ 2.22 is supported.

> Anyway, my first problem was that I needed to set the  
> PKG\_CONFIG\_PATH environment variable so that ruby-gnome2  
> could find my GTK installation. It took me a long time to  
> figure that out, so it would be nice to have a note in the  
> documentation.

Could you contribute your build instructions?  
We want to update the following documents:  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile\_mingw](http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile_mingw)  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile\_vc](http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile_vc)

> But then I ran into the problem that the mkmf-gnome2.rb  
> script doesn’t set the CFLAGS from pkg-config. I’m not  
> sure why because Kou’s pkg-config script makes it quite  
> easy.

Did you and pkg-config.rb find GTK+ \*.pc?

> But then finally, some GTK variables can’t be found.  
> It seems like 2.22 isn’t supported yet. But I can’t find  
> anything on the website saying what version _is_ supported.  
> I don’t believe it is 2.10 because that is more than 2  
> years old.

We can install Ruby/GTK2 binary with GTK+ 2.22 binaries by  
gem:

> gem install gtk2

The gem was built with MinGW on my Debian GNU/Linux. (It’s  
cross compile.)

But GTK+ version isn’t saied as you saied.  
We should update the following document…  
[http://ruby-gnome2.sourceforge.jp/hiki.cgi?Install+Guide+for+Windows](http://ruby-gnome2.sourceforge.jp/hiki.cgi?Install+Guide+for+Windows)

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [January 10, 2011, 2:09pm UTC](https://www.ruby-forum.com/t/problems-building-on-windows/201529/3 "2011-01-10T14:09:55Z")

</div>

Thanks for the quick reply!

On 10 January 2011 21:30, Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> GTK+ 2.22 is supported.

That’s good to know. Probably there was something else wrong.

> Could you contribute your build instructions?  
> We want to update the following documents:  
> [http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile\_mingw](http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile_mingw)  
> [http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile\_vc](http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile_vc)

OK. I will try again tomorrow. I am using mingw right now.  
If I can get it to work I will write some instructions.

> > But then I ran into the problem that the mkmf-gnome2.rb  
> > script doesn’t set the CFLAGS from pkg-config. I’m not  
> > sure why because Kou’s pkg-config script makes it quite  
> > easy.
> 
> Did you and pkg-config.rb find GTK+ \*.pc?

Yes. Once I set the PKG\_CONFIG\_PATH there was no  
problem. But the mkmf-gnome2.rb script doesn’t seem  
to use the config information. I added some code like:

gtk\_config = PackageConfig.new(“gtk±2.0”)  
CFLAGS += " " + gtk\_config.cflags

It is possible I misunderstood something and it is handled  
somewhere else. But I couldn’t get it to work without doing  
this.

> We can install Ruby/GTK2 binary with GTK+ 2.22 binaries by  
> gem:
> 
> > gem install gtk2
> 
> The gem was built with MinGW on my Debian GNU/Linux. (It’s  
> cross compile.)

Ahh. That’s VERY good 🙂 I didn’t realize it. I will use that.  
But I will try to get everything built and then update the  
documentation.  
My first language is English, so it’s will be easy for me once I  
understand  
what to do.

```
    MikeC

```

---

<div class="post-metadata">

**Author:** ![mikec](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/977dab/32.png) [@mikec](https://www.ruby-forum.com/u/mikec)\
**Post date:** [January 10, 2011, 2:38pm UTC](https://www.ruby-forum.com/t/problems-building-on-windows/201529/4 "2011-01-10T14:38:48Z")

</div>

Hi,

In [AANLkTinpwJC5Y-GPO5AZUsnG8SmXEJV3cjUUGv=removed\_email\_address@domain.invalid](mailto:AANLkTinpwJC5Y-GPO5AZUsnG8SmXEJV3cjUUGv=removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] Problems Building on Windows” on Mon, 10  
Jan 2011 22:09:04 +0900,  
Mike C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Could you contribute your build instructions?  
> > We want to update the following documents:  
> > [http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile\_mingw](http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile_mingw)  
> > [http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile\_vc](http://ruby-gnome2.sourceforge.jp/hiki.cgi?compile_vc)
> 
> OK. I will try again tomorrow. I am using mingw right now.  
> If I can get it to work I will write some instructions.

Thanks!

> gtk\_config = PackageConfig.new(“gtk±2.0”)  
> CFLAGS += " " + gtk\_config.cflags
> 
> It is possible I misunderstood something and it is handled  
> somewhere else. But I couldn’t get it to work without doing  
> this.

OK. I understand.  
The current mkmf-gnome2.rb requires GTK+ and required  
binaries are installed under  
RUBY\_GTK2\_TOP\_DIRECTORY/vendor/local/ direcotry.

.  
|-- ext  
| `-- gtk2 | ... . `– vendor  
`-- local  
|-- bin  
|-- lib  
…

See also directories in Ruby/GTK2 gem.

> My first language is English, so it’s will be easy for me once I understand  
> what to do.

Thanks! It will be very useful.

–  
kou
