Gambas 3 – Compile and Install

Unfortunately Gambas 3 is not yet in any distribution repository yet (2012-07-21: no longer true. See comment below) so this involves installing Gambas 3 from source code. This might be intimidating for new Linux users so I have written this note to show a hopefully easy-to-follow process. These instructions work on all Ubuntu versions (I have only installed on 11.04 in Gnome rather than Unity desktop) as well as Linux Mint 11 and I guess most Ubuntu derivatives. The process is similar for other distributions.

Go to and ‘Download Gambas 3’ using the button on the top right.
Download Gambs 3
This will put a compressed file with extension .tar.bz2 in your Downloads directory (e.g. /home/fred/Downloads). Leave the webpage open as we will be needing it again.

Open your Nautilus file manager (on Mint for example click on ‘Fred’s Home’ on the desktop). Navigate to the Downloads folder and double click on the Gambas3-x.xx.x.tar.bz2 file (where x will be the current version number).
File Manager
This will open the Archive Manager from which you can click the ‘Extract’ button. It does not matter where you place the extracted directory: it is easiest to leave it as a sub-directory in the Downloads directory.

Next we will need to open a terminal window. On Mint this is found under ‘Applications’, ‘Accessories’ and click on ‘Terminal’. The terminal window opens and the cursor is positioned at the end of a line which itself ends with ‘~ $’. We will be using terminal to do two things. The first is to install all the components that Gambas uses and the second is to compile and install the gambas source code itself.

On the Gambas webpage, click on ‘Compilation and Installation’. Go down (nothing like starting half way through the document!) to the section ‘How to compile and install Gambas on a specific distribution’ and click on Ubuntu.

This will list the dependency lists for the different versions of Ubuntu. Choose the relevant one for your distribution (Mint 11 is based on Ubuntu 11.04) and drag your mouse over the dependency list to select it. There is no specific entry for Ubuntu 11.10 (Oneiric) so just use the dependency list for Natty.

Hold down ‘ctrl’ key and press ‘c’ to copy this selection to the clipboard. Hold down ‘alt’ key and press ‘tab’ key until the terminal application is selected and then hold down ‘shift’ key and press ‘insert’ key to paste the dependency list into Terminal (you can also use the menu command Edit, paste). If you are using the Natty list for Oneiric, there is a problem with the entry kdelibs4-dev. Use the left arrow and change the 4 to 5 (i.e. kdelibs5-dev)

Press ‘enter’ key to run the very long ‘sudo apt-get install …’ line and supply a password. You will be advised which dependencies need to be downloaded. Press ‘y’ for yes to confirm. It will take a little time to download and install all these dependencies and will produce huge quantities of gibberish in the process. Eventually the cursor will return to the end of a new line ending ‘~ $’.

Next we need to change into the extracted Gambas source-code directory. From Terminal, type ‘cd /home/fred/Downloads/gambas3-x.xx.x’. ‘cd’ is the change directory command. fred is your home directory (change as required) and x.xx.x is once again the version of Gambas 3 which you have downloaded. Once you have correctly changed directory, the command line will end with the directory (e.g. ~/Downloads/gambas3-2.99.1) followed by $ rather than ‘~ $’.

Go back to the Gambas webpage and click on ‘Compilation and Installation’ again. Now we can start from the top. You will see that we have already completed the first instruction (cd). Each of the remaining compilation steps takes time and produces gibberish: don’t worry (be happy). Start with ‘./reconf-all’ and ‘enter’. Once you are back at the command line prompt type ‘./configure -C’ and ‘enter’. As you return to the command line prompt you should be given the message ‘All components will be compiled’. [2012/03/09: there is a new component under development. Don’t worry (be  happy) if you are told that gb.gsl will not be compiled] . If you are warned that some components will not be compiled then it is likely that you have failed to install some of the necessary dependencies. Next up is the compilation itself so type ‘make’ and ‘enter’. Once back at the prompt, you install it all by typing ‘sudo make install’ -and ‘enter’. It will prompt for your password.

When you finally get back to the prompt, you should be in a position to run Gambas by typing ‘gambas3’ and ‘enter’. Gambas3 won’t be inserted into your menu system but you can create a desktop launcher. Right-click on the desktop and click on ‘create launcher’. Use ‘Gambas3’ as a name, ‘gambas3’ as a command. Leave the comment field empty. You can change the icon by clicking on it and navigating to the gambas3.svg icon in the app/desktop subdirectory of your installation package (which will typically still be in ‘/home/fred/Downloads/gambas3-x.xx.x’ or whatever). If you plan to delete the installation directory, then you will have to move this file somewhere safe.-


7 Responses to “Gambas 3 – Compile and Install”

  1. thelung Says:

    ERROR: #2: Cannot load class ‘TableView’: Cannot load parent class: Cannot load class ‘GridView’: Unable to load class file

    this doesn’t work.

    • charlesg628 Says:

      Yes, I have been having the same kind of problems on one computer using Lubuntu 12.04. (another updates fine but is on Mint XFCE). These kind of errors are also being reported on the Gambas forum. I lack the skills to know where the problem lies (I suspect a dependency has changed) but my experience is that it will be corrected within a few days. The error does not seem to be consistent and this makes it all the more frustrating.

  2. Jean NAYMARD Says:

    I disagree with the first line of this page: gambas3 is available in the fedora repositeries, and I used this way already six month ago:
    root# yum list gambas*
    will give you the list of available programs.

    • charlesg628 Says:

      I am sure this is correct. I only picked up on this yesterday when installing Mageia (which presumably uses the Fedora repository) which can install Gambas 3.1.1. Good news for gambas!

  3. gambas moorthy Says:

    i got it installed gambas3 as per ur guidence . thanks. but all the examples are read only projects……

    • charlesg628 Says:

      Yes, that is right. It is no bad thing to keep the original examples read-only. All you have to do is ‘save as’ to another location on the hard disk and you will then be able to mess around with them.

      You may also get the message that the project is already open. Ignore the message.

      Be warned though that many of the examples, although marked as Gambas 3 examples, have not been converted from Gambas 2. Some don’t work. It’s a challenge!

  4. markas gambas Says:

    For indonesia people , you can visit my blog in

    good job !

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: