Lazarus

Programming => Widgetset => GTK => Topic started by: dubst3pp4 on January 04, 2019, 03:09:16 pm

Title: GTK3 linker problems on Ubuntu 18.04
Post by: dubst3pp4 on January 04, 2019, 03:09:16 pm
Hello,

I've downloaded the GTK3 bindings from Lazarus-ccr as described here: http://wiki.freepascal.org/Gtk%2B3#Info.
When I now want to compile the HelloWorld example, I get a linker error:

Quote
HelloWorld.lpr(47,1) Error: Error while linking
HelloWorld.lpr(47,1) Verbose: There were 1 errors compiling module, stopping

When I execute the linker command manually and add the -verbose option, I get some details on what's going on:

Quote
[...]
/home/marc/FreePascalProjects/lazarus-ccr-svn-r6778-bindings-gtk3/lib/x86_64-linux/gdkpixbuf2.o: In function `GETTEXT':
/home/marc/FreePascalProjects/lazarus-ccr-svn-r6778-bindings-gtk3//gdkpixbuf2.pas:469: undefined reference to `gdk_pixbuf_gettext'

And when I have a look into the gdkpixbuf2.pas file on line 469, there is a reference to a function called gdk_pixbuf_gettext which is causing the problems:

Code: Pascal  [Select][+][-]
  1. function TGdkPixbuf.gettext(msgid: Pgchar): Pgchar; cdecl;
  2. begin
  3.   Result := GdkPixbuf2.gdk_pixbuf_gettext(msgid);
  4. end;

The function is defined in the same file:

Code: Pascal  [Select][+][-]
  1. function gdk_pixbuf_gettext(msgid: Pgchar): Pgchar; cdecl; external;

and after a little research I found out, that this function should be defined in a header file called gdk-pixbuf-i18n.h. Although I installed all GTK3 development files, there is no package on Ubuntu which provides that file... I expected this file to be installed with the libgdk-pixbuf2.0-dev package.

Any hints are really welcome!  %)

 
Title: Re: GTK3 linker problems on Ubuntu 18.04
Post by: Akira1364 on January 05, 2019, 02:22:16 am
That definition was removed from the LCL bindings in April 2017 for exactly the reason you're describing, actually:

https://github.com/graemeg/lazarus/blob/upstream/lcl/interfaces/gtk3/gtk3bindings/lazgdkpixbuf2.pas (https://github.com/graemeg/lazarus/blob/upstream/lcl/interfaces/gtk3/gtk3bindings/lazgdkpixbuf2.pas)

As far as I know Laz-CCR is definitely not the right place to be downloading that kind of stuff (or anything in general really), at least currently. The bindings in the actual Lazarus trunk source tree (or even just the source tree of any stable Lazarus release, which is to say, if you have Lazarus you already have the bindings) will always be the most up-to-date.
Title: Re: GTK3 linker problems on Ubuntu 18.04
Post by: dubst3pp4 on January 07, 2019, 08:41:09 am
That definition was removed from the LCL bindings in April 2017 for exactly the reason you're describing, actually:

https://github.com/graemeg/lazarus/blob/upstream/lcl/interfaces/gtk3/gtk3bindings/lazgdkpixbuf2.pas (https://github.com/graemeg/lazarus/blob/upstream/lcl/interfaces/gtk3/gtk3bindings/lazgdkpixbuf2.pas)
Oh, yes, you're right! :D I thought the CCR is up to date with at least the stable version of Lazarus... Maybe I should update the wiki page.
But whereas in the Lazarus CCR there are some GTK3 examples (and a GTK3 package for Lazarus) these examples are missing in trunk and stable Lazarus. Why are they not distributed?

Thanks for your help!
TinyPortal © 2005-2018