How to get Lazarus up and running with gtk2 in Ubuntu i386 lazarus / 1-Linux ---------------------------------------------------------------------- nspur · 2008-05-21 15:52 Have you ever noticed that when you ask a stranger for directions when driving that they mostly assume that you know where you are anyway. Too often "Go down the hill, turn left at the Red Lion, then up Mangold Hill and down again and sharp right into Sheeply Bottom and there you are". So here is a novice's guide to installing Lazarus and getting it to use gtk2. First use Synaptic Package Manager and open Repositories from the Settings menu and make sure that everything is ticked on the Ubuntu and Third Party Software tabs. This will give you the widest search for software. Then click the Search button and type "fpc" to search for and when the list is shown click fpc, fpc-source and fpc-utils for installation. Install these which are the Free Pascal Compiler. Next, still in the package manager, search for Lazarus and click lazarus and fcp-source (yes choose that one again) for installation. Downloading will take some time and let it install. At this point you will have a working Lazarus but it won't look very pretty and will probably complain that you have not set the FPC source code directory. Click Environment/Environment Options on the Lazarus menu and type /usr/share/fpcsrc for the source code directory. Now you have to tell Lazarus where the gtk and gtk2 units are because the default installation doesn't do this. To do this you have to make the /etc/fpc.cfg file writeable and add two lines to it. Bring up a Terminal (Accessories menu) and type sudo -i to become the Root user. You will need to supply your password. For the root user the prompt sign changes from $ to #. Type cd /etc to change to the etc directory. To make the fpc config file writeable type chmod +w fpc.cfg and hit the Return key. Now enter the editor by typing gedit fpc.cfg. Gedit brings up the configuration file. Page through it to find the section that starts # searchpath for units and other system dependent things. Open up two spaces under this section and type -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/gtk -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/gtk2 It may not strictly speaking be necessary to do this but my system could not find the files without these lines. Save the file. If by any chance you have lost your Root identity, assume it again because you are going to start Lazarus as Root because it needs superuser privileges to recompile itself and link in the gtk2 libraries. You can start Lazarus from the Applications/Programming menu. Choose Tools and Configure Build Lazarus. You will be presented with the Quick tab but click the Advanced one. In this panel click the third button from the left in the list box column headers to set Clean + Build options for the LCL and the IDE, tick GTK2 as the option and With Packages. Type /usr/lib/lazarus into the Target Dir box and i386 into the Target CPU one. Also tick Restart after successful build and Confirm before rebuilding Lazarus and click the Save button. Now you can click the Build button and the build will (should do, mine did) happen. Voila! ---------------------------------------------------------------------- krezix · 2008-06-03 13:58 Good One! It worked perfectly with me xD thanx