Revision [17416]

This is an old revision of CompilerInstalling made by MikeKennedy on 2015-01-05 15:32:07.



Installing FreeBASIC, any additionally needed packages, and perhaps a text editor or IDE.

Windows 32bit
  1. Download the latest FreeBASIC-x.xx.x-win32.exe installer
  2. Run it and click through it. The installer will install FreeBASIC at C:\%ProgramFiles%\FreeBASIC, or if you chose a different installation directory, in your chosen directory. Start Menu shortcuts to the website will be installed as well.
  3. Unless you already have a source code editor or IDE, you should install one too, as FreeBASIC itself does not include one. An IDE can be used to write and save .bas files and to launch the FreeBASIC Compiler to compile them. The following IDEs are known to explicitly support FreeBASIC:
To uninstall FreeBASIC, remove it from the system's list of installed software (Add/remove programs, Uninstall or change a program).

Windows x64
  1. Download the latest package
  2. Extract it where you like, for example at C:\%ProgramFiles%\FreeBASIC (no further installation required to use fbc).
  3. You may want to install a source code editor or IDE; also see the Windows 32bit section.
To uninstall FreeBASIC, simply deleted the directory where you extracted it.

  1. Download the latest FreeBASIC-x.xx.x-linux-x86.tar.gz (32bit) or FreeBASIC-x.xx.x-linux-x86_64.tar.gz (64bit) package
  2. Extract the archive, for example by doing right-click -> Extract Here, or manually in a terminal:

  3. $ cd Downloads
    $ tar xzf FreeBASIC-x.xx.x-linux-x86.tar.gz

  4. The FreeBASIC compiler can be used from where it was extracted. Usually it is installed into the /usr/local system directory though, so that the fbc program is available through-out the whole system. To do that, run the included installation script:

  5. $ cd FreeBASIC-x.xx.x-linux-x86
    $ sudo ./ -i

    The script can also be given a path as in ./ -i /usr if you prefer to install into a directory other than the default /usr/local. This default is a good choice though, as it avoids mixing with the content of /usr which is usually managed by the distribution's packaging tool.

  6. FreeBASIC requires several additional packages to be installed before it can be used to compile executables. In general, these are:

    • binutils
    • libc development files (installing gcc will typically install these too)
    • gcc
    • libncurses development files
    • X11 development files (for FB graphics programs)
    • libffi development files (for the KeyPgThreadCall ThreadCall keyword)
    • gpm (general purpose mouse) daemon and libgpm (only needed for GetMouse support in the Linux console)

    The actual package names to install vary depending on the GNU/Linux distribution.

    For native development (32bit FB on 32bit system, or 64bit FB on 64bit system):
    • Debian/Ubuntu:
      • gcc
      • libncurses5-dev
      • libffi-dev
      • libgl1-mesa-dev
      • libx11-dev libxext-dev libxrender-dev libxrandr-dev libxpm-dev
    • Fedora:
      • gcc
      • ncurses-devel
      • libffi-devel
      • mesa-libGL-devel
      • libX11-devel libXext-devel libXrender-devel libXrandr-devel libXpm-devel
    • OpenSUSE:
      • gcc
      • ncurses-devel
      • libffi46-devel
      • xorg-x11-devel

    For 32bit development on a 64bit system:
    • Debian/Ubuntu:
      • gcc-multilib
      • lib32ncurses5-dev
      • libx11-dev:i386 libxext-dev:i386 libxrender-dev:i386 libxrandr-dev:i386 libxpm-dev:i386
      • (See comment below re Ubuntu 10.04 LTS)
    • OpenSUSE:
      • gcc-32bit
      • ncurses-devel-32bit
      • xorg-x11-devel-32bit
      • xorg-x11-libX11-devel-32bit
      • xorg-x11-libXext-devel-32bit
      • xorg-x11-libXrender-devel-32bit
      • xorg-x11-libXpm-devel-32bit
      • libffi46-devel-32bit

  1. Unless you already have a text editor or IDE, you should install one too, as FreeBASIC itself does not include one. An IDE can be used to write and save .bas files and to launch the FreeBASIC Compiler to compile them. The following IDEs are known to explicitly support FreeBASIC:

To uninstall FreeBASIC from /usr/local, you can run the script again, but with the -u option: sudo ./ -u

  1. Download the latest archive
  2. Find a place for FreeBASIC with at least 13 MiB free space.
  3. Unpack the ZIP archive, making sure that the directory structure as used inside the archive is preserved ("PKUNZIP -d" for example).
  4. The top-level directory is named FreeBASIC-x.xx.x-dos (will be truncated to "FREEBASI" in DOS without full LFN support), so you might want to rename it then to a convenient DOS-compliant name not longer than 8 characters and containing no white-spaces, like "FB".
  5. All the important files used by the compiler (includes, libs) inside the archive do have DOS-compliant names, therefore DOSLFN is not required to use FreeBASIC, however, some examples and texts do have longer names and will be truncated when extracted without full LFN support.

(Note: you can install the DOS version "over" the Windows one or vice-versa, or "merge" those installations later, but rename the FBC.EXE file of the previous installation to FBCW.EXE , FBCD.EXE or such, or it will be overwritten by the new one. Other platform specific files are placed in subdirectories making sure that they won't conflict.)

Compiling under Ubuntu 10.04 LTS, 64-bit:
Install all of the above Libraries, as advised. Some of the entries ending in “:i386” may throw “not found” errors.
To verify that you’re using a 64-bit build, use: “uname -a” or “uname -m” (it’ll show x86_64 for 64-bit, i386 for 32-bit).
Then, when running FBC, an error may appear: “error while loading shared libraries: cannot open shared object file: No such file or directory”.

“” is available as a separate library in Ubuntu 11.10+, but it is built into “” in 10.04 LTS. So, we need to re-direct the libtinfo references into the libraries:
  1. Issue: find / -name '' - just to verify that there are no confusing references to these libraries anywhere. Any references should be checked, and probably deleted?
  2. Change to the folder containing the FBC executable (perhaps “/usr/local/bin/”).
  3. Issue: ldd fbc - it will list the various library folder(s) being searched (probably “/lib32” in most cases).
  4. Issue: sudo ln -s /lib32/ /lib32/ (assuming “/lib32” was emitted in the previous step).
  5. Issue: sudo ln -s /lib32/ /lib32/ (assuming “/lib32”...)
  6. Retry! [Mike Kennedy, Jan, 2015. (This note was not acceptable as a standard "comment"?)].

See also:
Back to Table of Contents
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki phatcode