Compiling against gtk2 lazarus / 1-Linux ---------------------------------------------------------------------- anthony · 2008-11-06 13:41 Using Lazarus 0.9.26 I understand there are problems using gtk2 for the ide. I have no problem with a gtk1 IDE but my applications must be gtk2. I installed Lazarus from source on Mandriva 2009.0 and it works fine in gtk1. Mandriva uses KDE4, installed package : libgtk+2.0_0-devel rev. 2.14.3 I followed the instruction as given in http://wiki.lazarus.freepascal.org/GTK2_Interface Quote Now compile the LCL for gtk2. First open your normal compiled Lazarus. Then go on the menu "Tools" --> "Configure Build Lazarus". Set LCL to "clean+build" and everything else to "None". Now select "gtk2" and click on the "Ok" button. Next go to the menu "Tools" --> "Build Lazarus". Now the LCL is compiled for gtk2 too. (Note: the default widgetset is still there and not overwritten). To compile a project for gtk2 just select it as the target widgetset on the Compiler Options dialog. If I compile a form containing a button, a gtk1 button in the IDE, I get the message: Quote /usr/lib/fpc/2.2.2/units/i386-linux/gtk2/gtk2.o: In function `GTK2_GTK_FILE_SYSTEM_ERROR$$LONGWORD': gtk2.pas:(.text+0xb7b1): undefined reference to `gtk_file_system_error_quark' /usr/lib/fpc/2.2.2/units/i386-linux/gtk2/gtk2.o: In function `GTK2_GTK_TYPE_FILE_INFO$$LONGWORD': gtk2.pas:(.text+0xb7c1): undefined reference to `gtk_file_info_get_type' /usr/lib/fpc/2.2.2/units/i386-linux/gtk2/gtk2.o: In function `GTK2_GTK_TYPE_FILE_SYSTEM$$LONGWORD': gtk2.pas:(.text+0xb7d1): undefined reference to `gtk_file_system_get_type' /usr/lib/fpc/2.2.2/units/i386-linux/gtk2/gtk2.o: In function `GTK2_GTK_TYPE_FILE_FOLDER$$LONGWORD': gtk2.pas:(.text+0xb851): undefined reference to `gtk_file_folder_get_type' project1.lpr(17,1) Error: Error while linking project1.lpr(17,1) Fatal: There were 1 errors compiling module, stopping I tried 0.9.26.1 beta SVN revision 17244 with the same result. In my previous distribution Mandriva 2008.1 the Lazarus 0.9.24 IDE and my application both used the gtk2 widget set fine. For the time being I go back to this release configuration. How to proceed?  thanks. ---------------------------------------------------------------------- Chrrris · 2008-11-06 17:45 Hi Anthony, See the thread entitled Cannot build Lazarus after upgrading to Ubuntu 8.10. It's the same issue - you need to use Freepascal 2.3.1 I hope that helps. ---------------------------------------------------------------------- anthony · 2008-11-12 08:09 Dear Chrrris, Thank you for your reply. I Downloaded version 2.3.1 but I have no idea how to install it as it has no install.sh script nor a readme or install file. Because 2.2.0 on mandriva 2008.1 had nice gtk2 I removed 2.2.2 from MDV 2009.0 and installed 2.2.0 and recompiled it to gtk2 with the same unsuccessful result. conclusion : there is an incompatibility between Lazarus and newer Linux distributions. ---------------------------------------------------------------------- Leledumbo · 2008-11-12 12:11 QuoteI Downloaded version 2.3.1 but I have no idea how to install it as it has no install.sh script nor a readme or install file. Just copy it to appropriate dirs. All executables except ppc386 to /usr/bin and lib to /usr/lib, then create symlinks from ppc386 under /usr/lib/fpc/2.3.1/ppc386 to /usr/bin/ppc386. This method worked for me (I always build from source since then). ---------------------------------------------------------------------- Chrrris · 2008-11-15 04:43 Quote from: "anthony" Because 2.2.0 on mandriva 2008.1 had nice gtk2 I removed 2.2.2 from MDV 2009.0 and installed 2.2.0 and recompiled it to gtk2 with the same unsuccessful result. conclusion : there is an incompatibility between Lazarus and newer Linux distributions. Your conclusion isn't quite right - the incompatibility is between FPC 2.2.2 (and earlier) and the version of GTK shipped with newer Linux distros. That's why you need to upgrade to FPC 2.3.1 to fix the problem. http://wiki.lazarus.freepascal.org/Installing_Lazarus#Installing_Free_ Pascal_under_Linux.2FBSD_manually should get you up-and-running with FPC 2.3.1.