# Compile problems gtk2, ruby-gnome2-all-1.1.2

**URL:** <https://www.ruby-forum.com/t/compile-problems-gtk2-ruby-gnome2-all-1-1-2/216439>\
**Category:** Ruby-Gnome 2\
**Created:** [February 5, 2012, 1:16am UTC](https://www.ruby-forum.com/t/compile-problems-gtk2-ruby-gnome2-all-1-1-2/216439 "2012-02-05T01:16:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [February 5, 2012, 1:16am UTC](https://www.ruby-forum.com/t/compile-problems-gtk2-ruby-gnome2-all-1-1-2/216439/1 "2012-02-05T01:16:01Z")

</div>

I’m using RHEL 5.7.  
My base ruby is 1.9.3p0  
gcc 4.1.2  
gtk2-2.10.4-21.el5\_5.6

I have been trying to get gtk2 from 1.1.2 to build, “ruby extconf.rb”  
checks out fine. Says gtk2 is good to build.

However, halfway through compilation it bombs on rbgtkprintsettings.c.

The compile time error is:  
rbgtkprintsettings.c: In function ‘Init\_gtk\_print\_settings’:  
rbgtkprintsettings.c:704: error: ‘rg\_initialize’ undeclared (first use  
in this function)

I tried dropping back to previous versions. See the same thing in:  
1.1.1  
1.1.0

When I hit 1.0.3, the compile problem goes away. So it looks like  
something that was introduced in 1.1.0.

I can get this to work on some other systems I tried, just not on  
these RHEL 5.x machines(64 and 32 bit ones)

Thanks for any help.

---

<div class="post-metadata">

**Author:** ![grantspeelman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/da6949/32.png) [@grantspeelman](https://www.ruby-forum.com/u/grantspeelman)\
**Post date:** [February 5, 2012, 1:34am UTC](https://www.ruby-forum.com/t/compile-problems-gtk2-ruby-gnome2-all-1-1-2/216439/2 "2012-02-05T01:34:53Z")

</div>

On Sat, Feb 4, 2012 at 5:15 PM, grant schoep [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> The compile time error is:
> 
> I can get this to work on some other systems I tried, just not on  
> these RHEL 5.x machines(64 and 32 bit ones)
> 
> Thanks for any help.

Ah, never fails, I ask a question and then figure it out about as I hit  
send.

Line numbers here related to 1.1.2 release

The problem is, in rbgtkprintsettings.c.

For the block #if GTK\_CHECK\_VERSION(2,12,0)

If its not 2,12 it uses the 2nd block  
However, it is using the old naming. Basically it has  
#if GTK\_CHECK\_VERSION(2,12,0)  
static VALUE  
rg\_initialize(int argc, VALUE \*argv, VALUE self)  
{  
…  
#else  
static VALUE  
ps\_initialize(VALUE self)  
{  
…  
#endif

That should be rg\_initialize again, not ps\_initialize.

---

<div class="post-metadata">

**Author:** ![grantspeelman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/da6949/32.png) [@grantspeelman](https://www.ruby-forum.com/u/grantspeelman)\
**Post date:** [February 5, 2012, 10:41am UTC](https://www.ruby-forum.com/t/compile-problems-gtk2-ruby-gnome2-all-1-1-2/216439/3 "2012-02-05T10:41:16Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] compile problems gtk2,  
ruby-gnome2-all-1.1.2” on Sat, 4 Feb 2012 17:33:59 -0700,  
grant schoep [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> #if GTK\_CHECK\_VERSION(2,12,0)
> 
> That should be rg\_initialize again, not ps\_initialize.

Thanks! I’ve fixed the problem. 🙂

–  
kou

---

<div class="post-metadata">

**Author:** ![grantspeelman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/da6949/32.png) [@grantspeelman](https://www.ruby-forum.com/u/grantspeelman)\
**Post date:** [April 2, 2012, 7:34pm UTC](https://www.ruby-forum.com/t/compile-problems-gtk2-ruby-gnome2-all-1-1-2/216439/4 "2012-04-02T19:34:42Z")

</div>

Kouhei S. wrote in post #1044133:

> Hi,
> 
> In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
> “Re: [ruby-gnome2-devel-en] compile problems gtk2,  
> ruby-gnome2-all-1.1.2” on Sat, 4 Feb 2012 17:33:59 -0700,  
> grant schoep [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > #if GTK\_CHECK\_VERSION(2,12,0)
> > 
> > That should be rg\_initialize again, not ps\_initialize.
> 
> Thanks! I’ve fixed the problem. 🙂
> 
> –  
> kou

Could you share how to fix the problem clearly?

I meet the same question and I really want to know how to fix it.

Thanks,

---

<div class="post-metadata">

**Author:** ![grantspeelman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/da6949/32.png) [@grantspeelman](https://www.ruby-forum.com/u/grantspeelman)\
**Post date:** [April 3, 2012, 4:18am UTC](https://www.ruby-forum.com/t/compile-problems-gtk2-ruby-gnome2-all-1-1-2/216439/5 "2012-04-03T04:18:41Z")

</div>

> Could you share how to fix the problem clearly?
> 
> I meet the same question and I really want to know how to fix it.
> 
> If it the problem I had, compiling rbgtkprintsettings.c

You want to find the “ps\_initialize” part and change it to  
rg\_initialize.  
The snippet of code was like

#if GTK\_CHECK\_VERSION(2,12,0)  
static VALUE  
rg\_initialize(int argc, VALUE \*argv, VALUE self)  
{  
…  
#else  
static VALUE  
ps\_initialize(VALUE self)  
\<-------------------------This line should be rs\_ not ps\_  
{  
…  
#endif

Kou checked the fix in, sometimes when I hit these buggers, I like to  
grab  
the latest version from git and do some vimdiffs.

The git page is nice too, you can see the diff/delta’s on exactly what  
was  
changed with each fix. Without having to checkout each version and diff  
them. Yes, sometimes the latter is better IMHO, but then that me…
