Ruby Forum Ruby-Gnome 2 > Error, while compiling ruby/pango on my mac...

Posted by Julian Weimer (webmonkey)
on 09.06.2008 17:33
Hi there.
I tried to compile and install ruby/gnome2 (ver. 0.17.0rc1 ) on my
system (Mac OSX 10.5, PPC G4).
Everything worked fine, except the pango/ruby-package was cpmplaining,
during the "make"-process.

I got the following errors:

rbpangolayoutiter.c:27: error: invalid application of ‘sizeof’ to
incomplete type ‘PangoLayoutIter’
rbpangolayoutiter.c:28: error: dereferencing pointer to incomplete type
rbpangolayoutiter.c:28: error: dereferencing pointer to incomplete type
rbpangolayoutiter.c: In function ‘layout_iter_copy’:
rbpangolayoutiter.c:27: error: invalid application of ‘sizeof’ to
incomplete type ‘PangoLayoutIter’
rbpangolayoutiter.c:28: error: dereferencing pointer to incomplete type
rbpangolayoutiter.c:28: error: dereferencing pointer to incomplete type
lipo: can't open input file:
/var/folders/YC/YCMZBk2ZHlyLER20dBkBYk+++TI/-Tmp-//cc6EO8Hc.out (No such
file or directory)
make[1]: *** [rbpangolayoutiter.o] Error 1
make: *** [all] Error 2

I also tried those older versions of ruby/gnome2 (0.16, 0.15), but I got
even more errors with them.
GTK+ is already installed.

Any suggestions?
Posted by Kouhei Sutou (Guest)
on 10.06.2008 14:05
(Received via mailing list)
Hi,

In <d522ee5bd6eb31b0438c86472a07ca10@ruby-forum.com>
  "[ruby-gnome2-devel-en] Error, while compiling ruby/pango on my 
mac..." on Mon, 9 Jun 2008 17:33:07 +0200,
  Julian Weimer <ruby-forum-incoming@andreas-s.net> wrote:

> I tried to compile and install ruby/gnome2 (ver. 0.17.0rc1 ) on my
> system (Mac OSX 10.5, PPC G4).
> Everything worked fine, except the pango/ruby-package was cpmplaining,
> during the "make"-process.
> 
> I got the following errors:
> 
> rbpangolayoutiter.c:27: error: invalid application of ‘sizeof’ to
> incomplete type ‘PangoLayoutIter’

What about the following patch?

Index: rbpangolayoutiter.c
===================================================================
--- rbpangolayoutiter.c  (revision 3234)
+++ rbpangolayoutiter.c  (working copy)
@@ -14,7 +14,7 @@
 #define _SELF(r) ((PangoLayoutIter*)RVAL2BOXED(r, 
PANGO_TYPE_LAYOUT_ITER))

 /**********************************/
-#if ! HAVE_PANGO_LAYOUT_ITER_GET_TYPE
+#ifndef HAVE_PANGO_LAYOUT_ITER_GET_TYPE
 static PangoLayoutIter*
 layout_iter_copy(ref)
     const PangoLayoutIter* ref;


Thanks,
--
kou
Posted by Julian Weimer (webmonkey)
on 10.06.2008 17:29
Kouhei Sutou wrote:
> Hi,
> 
> In <d522ee5bd6eb31b0438c86472a07ca10@ruby-forum.com>
>   "[ruby-gnome2-devel-en] Error, while compiling ruby/pango on my 
> mac..." on Mon, 9 Jun 2008 17:33:07 +0200,
>   Julian Weimer <ruby-forum-incoming@andreas-s.net> wrote:
> 
>> I tried to compile and install ruby/gnome2 (ver. 0.17.0rc1 ) on my
>> system (Mac OSX 10.5, PPC G4).
>> Everything worked fine, except the pango/ruby-package was cpmplaining,
>> during the "make"-process.
>> 
>> I got the following errors:
>> 
>> rbpangolayoutiter.c:27: error: invalid application of ‘sizeof’ to
>> incomplete type ‘PangoLayoutIter’
> 
> What about the following patch?
> 
> Index: rbpangolayoutiter.c
> ===================================================================
> --- rbpangolayoutiter.c  (revision 3234)
> +++ rbpangolayoutiter.c  (working copy)
> @@ -14,7 +14,7 @@
>  #define _SELF(r) ((PangoLayoutIter*)RVAL2BOXED(r, 
> PANGO_TYPE_LAYOUT_ITER))
> 
>  /**********************************/
> -#if ! HAVE_PANGO_LAYOUT_ITER_GET_TYPE
> +#ifndef HAVE_PANGO_LAYOUT_ITER_GET_TYPE
>  static PangoLayoutIter*
>  layout_iter_copy(ref)
>      const PangoLayoutIter* ref;
> 
> 
> Thanks,
> --
> kou

I thank you for your quick responce.
So I patched the file that way:
I saved your patch as a .diff file and did => patch --input 
../patch.diff in the src dir.

As I configured and compiled the pango/ruby-package once more it failed 
again and exactly the same errors appeared.
Posted by Florian Petran (fpetran)
on 11.06.2008 01:29
Julian Weimer wrote:
> Kouhei Sutou wrote:
>> Hi,
>> 
>> In <d522ee5bd6eb31b0438c86472a07ca10@ruby-forum.com>
>>   "[ruby-gnome2-devel-en] Error, while compiling ruby/pango on my 
>> mac..." on Mon, 9 Jun 2008 17:33:07 +0200,
>>   Julian Weimer <ruby-forum-incoming@andreas-s.net> wrote:
>> 
>>> I tried to compile and install ruby/gnome2 (ver. 0.17.0rc1 ) on my
>>> system (Mac OSX 10.5, PPC G4).
>>> Everything worked fine, except the pango/ruby-package was cpmplaining,
>>> during the "make"-process.
>>> 
>>> I got the following errors:
>>> 
>>> rbpangolayoutiter.c:27: error: invalid application of ‘sizeof’ to
>>> incomplete type ‘PangoLayoutIter’
>> 
>> What about the following patch?
>> 
>> Index: rbpangolayoutiter.c
>> ===================================================================
>> --- rbpangolayoutiter.c  (revision 3234)
>> +++ rbpangolayoutiter.c  (working copy)
>> @@ -14,7 +14,7 @@
>>  #define _SELF(r) ((PangoLayoutIter*)RVAL2BOXED(r, 
>> PANGO_TYPE_LAYOUT_ITER))
>> 
>>  /**********************************/
>> -#if ! HAVE_PANGO_LAYOUT_ITER_GET_TYPE
>> +#ifndef HAVE_PANGO_LAYOUT_ITER_GET_TYPE
>>  static PangoLayoutIter*
>>  layout_iter_copy(ref)
>>      const PangoLayoutIter* ref;
>> 
>> 
>> Thanks,
>> --
>> kou
> 
> I thank you for your quick responce.
> So I patched the file that way:
> I saved your patch as a .diff file and did => patch --input 
> ../patch.diff in the src dir.
> 
> As I configured and compiled the pango/ruby-package once more it failed 
> again and exactly the same errors appeared.

Hi,

I had the same error, and I fixed it by replacing, in file 
"pango/src/pangolayoutiter.c" at about line 22
#if PANGO_CHECK_VERSION(1,6,0)
with
#if 0
Thereby effectively commenting out the section where the comment 
predicts breakage.
Posted by Julian Weimer (webmonkey)
on 11.06.2008 01:45
Many thanks!
It works just fine.
Now there is a real solution online for that issue.
(... I think so)
Posted by Kouhei Sutou (Guest)
on 11.06.2008 01:45
(Received via mailing list)
2008/6/11 Julian Weimer <ruby-forum-incoming@andreas-s.net>:

> As I configured and compiled the pango/ruby-package once more it failed
> again and exactly the same errors appeared.

What about the following patch?

And could you show your 'ruby extconf.rb' output and mkmf.log?


Index: pango/extconf.rb
===================================================================
--- pango/extconf.rb  (revision 3238)
+++ pango/extconf.rb  (working copy)
@@ -16,17 +16,18 @@
 PKGConfig.have_package('pango') or exit 1
 setup_win32(PACKAGE_NAME)

-have_func("pango_layout_iter_get_type")
-have_func("pango_layout_set_ellipsize")
-have_func("pango_layout_get_font_description")
-have_func("pango_render_part_get_type")
-have_func("pango_attr_strikethrough_color_new")
-have_func("pango_attr_underline_color_new")
-have_func("pango_glyph_item_free")
-have_func("pango_glyph_item_get_type")
-have_func("pango_attr_iterator_get_attrs")
-have_func("pango_itemize_with_base_dir")
-have_func("pango_font_family_is_monospace")
+pango_header = "pango/pango.h"
+have_func("pango_layout_iter_get_type", pango_header)
+have_func("pango_layout_set_ellipsize", pango_header)
+have_func("pango_layout_get_font_description", pango_header)
+have_func("pango_render_part_get_type", pango_header)
+have_func("pango_attr_strikethrough_color_new", pango_header)
+have_func("pango_attr_underline_color_new", pango_header)
+have_func("pango_glyph_item_free", pango_header)
+have_func("pango_glyph_item_get_type", pango_header)
+have_func("pango_attr_iterator_get_attrs", pango_header)
+have_func("pango_itemize_with_base_dir", pango_header)
+have_func("pango_font_family_is_monospace", pango_header)

 PKGConfig.have_package('pangocairo')
 if have_header('rb_cairo.h')


Thanks,
--
kou