# FreeBASIC: a QuickBASIC dialect that compiles to native binaries

> FreeBASIC is a command line BASIC compiler with QuickBASIC-like syntax that adds pointers, object orientation, unsigned types and inline assembly, and it produces native executables for Windows, Linux and DOS. It suits someone who learned BASIC on a DOS machine and wants a modern toolchain, and it is a compiler rather than an editor.

**freebasic/fbc** — FreeBASIC is a completely free, open-source, multi-platform BASIC compiler, with syntax similar to MS-QuickBASIC, that adds new features such as pointers, object orientation, unsigned data types, inline assembly, and many others.

- Repository: https://github.com/freebasic/fbc
- Website: https://www.freebasic.net
- Stars: 1,121 · Forks: 173
- Language: FreeBASIC
- License: not declared
- Published: 2026-10-19 · Updated: 2026-10-19 · Language: en
- Canonical page: https://hysenlabs.com/projects/freebasic-fbc

## A compiler, a runtime and a set of headers

FreeBASIC is a completely free, open-source, multi-platform BASIC compiler with syntax similar to MS-QuickBASIC, and it adds features such as pointers, object orientation, unsigned data types, inline assembly and others. The homepage is freebasic.net, the primary language is listed as FreeBASIC, and the copyright line reads 2004 to 2025 for the development team.

The project breaks into three parts, and the split is the thing to understand first. FreeBASIC consists of fbc, the command line compiler, the runtime libraries libfb and libfbgfx, and FreeBASIC header files for third-party libraries.

Then there is the toolchain dependency, which the README states plainly. To produce executables, fbc uses the GNU binutils, the assembler and linker, and when compiling for architectures other than 32-bit, fbc depends on gcc to generate the assembly.

That is the whole deployment model. fbc is not a self-contained toolchain; it drives binutils and, off 32-bit, gcc. Which means a build environment needs those installed, and the per-platform package lists in the installation instructions are not optional extras.

The release history is measured in years rather than months. FreeBASIC 1.10.1 was released on 2023-12-25, 1.10.0 on 2023-05-15 and 1.09.0 on 2022-01-01, and the last push to the master branch was on 2026-04-05. The fbc project page is on SourceForge with a GitHub mirror.

## Compiling and running a hello world on each platform

The usage instructions are the same on every platform once the compiler is installed, and the differences are all in how you get the binaries.

On Windows, in a command prompt from the installation directory, you compile and then run:

```
> fbc.exe examples\hello.bas
```

which creates examples\hello.exe in the FreeBASIC installation directory, and you run it with:

```
> examples\hello.exe
```

The Windows packages come in a few shapes. The combined standalone packages for Windows provide fbc32.exe for 32-bit and fbc64.exe for 64-bit instead of fbc.exe, distributed as FreeBASIC-x.xx.x-winlibs-gcc-9.3.0.7z or FreeBASIC-x.xx.x-gcc-5.2.0.7z, and there are separate 32-bit and 64-bit standalone packages based on winlibs-gcc-9.3.0 as zip or 7z archives. There is also a FreeBASIC-x.xx.x-win32.exe installer, but the README says it should only be installed on win32 platforms.

On Linux, if FreeBASIC is not available through your package manager, you download and extract the latest FreeBASIC-x.xx.x-linux.tar.gz, open a terminal, cd into the extracted directory and run:

```
sudo ./install.sh -i
```

to copy the setup into /usr/local, and then compile from the examples directory:

```
$ fbc hello.bas
```

which creates the hello program, run with:

```
$ ./hello
```

On DOS, the package is FreeBASIC-x.xx.x-dos.zip, and the invocation is the same shape as Windows:

```
> fbc.exe examples\hello.bas
```

The consistency across three operating systems is the point of the project, and the platform differences are entirely in packaging and in the host libraries you need.

## The Linux package list, and the 32-bit multilib wrinkle

To compile FreeBASIC programs on Linux you need some packages, and the names vary by distribution.

For Debian and Ubuntu the list is gcc, libncurses5-dev, libffi-dev, libgl1-mesa-dev, libx11-dev, libxext-dev, libxrender-dev, libxrandr-dev, libxpm-dev, libtinfo5 and libgpm-dev.

For Fedora it is gcc, ncurses-devel, ncurses-compat-libs, libffi-devel, mesa-libGL-devel, libX11-devel, libXext-devel, libXrender-devel, libXrandr-devel and libXpm-devel.

The two lists are close enough that the pattern is obvious: a compiler, the ncurses and ffi development headers, the X11 set, the Mesa GL header and the two image libraries FreeBASIC's graphics library uses.

There is a specific wrinkle for the 32-bit build on a 64-bit system. To use the 32-bit version of FreeBASIC on a 64-bit machine you need the gcc 32-bit multilib support and 32-bit versions of the libraries installed, and the Debian and Ubuntu list for that is gcc-multilib, lib32ncurses5-dev, libx11-dev:i386, libxext-dev:i386, libxrender-dev:i386, libxrandr-dev:i386, libxpm-dev:i386 and libtinfo5:i386.

The i386 suffixes are the detail that matters, because installing the amd64 development packages gives you headers that will not link against a 32-bit build.

The editor side is optional. The README mentions Geany for Linux with sudo apt-get install geany, and on Windows it points at Tiko editor, VisualFBEditor, and notes that FBIDE is older and unmaintained but will work with some effort.

## The licensing split, and the static linking exception

The licensing section is the part of the README that has real consequences, because the compiler and the libraries are under different licences.

The FreeBASIC compiler, fbc, is licensed under the GNU GPLv2 or later. The FreeBASIC runtime library, libfb and its thread-safe version libfbmt, and the FreeBASIC graphics library, libfbgfx and libfbgfxmt, are licensed under the GNU LGPLv2 or later, with an exception.

The exception is worth reading rather than skimming. As a special exception, the copyright holders give you permission to link the library with independent modules to produce an executable, regardless of the licence terms of those independent modules, and to copy and distribute the resulting executable under terms of your choice, provided you also meet, for each linked independent module, the terms and conditions of that module's licence. An independent module is one not derived from or based on the library. If you modify the library you may extend the exception to your version, and if you do not wish to do so you can delete the exception statement from your version.

So a closed source program that links the FreeBASIC runtime, without modifying the runtime, can be distributed under terms of your choice, as long as the other libraries it links obey their own terms. That is the practical difference between the compiler being GPL and the runtime being LGPL with this carve-out, and it is why the two pieces are licensed differently in the first place.

The documentation is licensed under the GNU FDL, and the README has a section for dependencies on third-party libraries.

## What the source tree and the examples give you

The repository is a compiler source tree rather than an application, and the layout shows the structure of the tool.

At the top level there is a makefile, a version.mk, a changelog.txt and a todo.txt, alongside src/ for the compiler itself, inc/ for headers, lib/ for the runtime and graphics libraries, doc/ for the manual sources, examples/ for the sample programs, tests/, contrib/ and a .travis.yml.

The examples directory is the interesting part for anyone evaluating the language, because the folder names are a feature list. There are DOS/ and GUI/ directories, a Makefile, and subdirectories for OptimizePureAbstractTypes, compression, console, database, dll and files, alongside individual files for the language features: allocate.bas for memory allocation, arrays.bas, bitfield.bas, byref-results.bas for the byref calling convention, class.bas for object orientation, cmdline.bas for command line handling, const.bas, constructor.bas and enum.bas.

Files covers file and directory handling, graphics covers the graphics library, and the OptimizePureAbstractTypes directory is a specific compiler feature rather than a general topic, which tells you the project cares about code generation quality rather than only about language surface.

The README also points to the online manual, the compiler features page and the compiler requirements page on the wiki, plus a forum, a Discord server and an IRC channel, so there is a community around the tool even though the release cadence is measured in years.

## Conclusion

Adopt FreeBASIC if you want to write BASIC and get a native executable without installing a language runtime on the target machine, because the compiler emits real binaries through GNU binutils rather than shipping an interpreter. Do not expect an IDE, because the README is explicit that fbc is not a graphical code editor, and do not start a new multi-platform project on it without reading the licensing section, because the compiler is GPLv2 while the runtime libraries are LGPLv2 with a static linking exception that has conditions. Before you build on 64-bit targets, note that the compiler depends on gcc to generate the assembly for architectures other than 32-bit, and install the binutils and gcc toolchain your platform needs.

## FAQ

### What is FreeBASIC and what does the compiler need?

It is a completely free, open-source, multi-platform BASIC compiler with syntax similar to MS-QuickBASIC that adds pointers, object orientation, unsigned data types and inline assembly. It consists of fbc, the command line compiler, the runtime libraries libfb and libfbgfx, and headers for third-party libraries. To produce executables fbc uses the GNU binutils, and for architectures other than 32-bit it depends on gcc to generate the assembly.

### How do I compile and run a program with FreeBASIC?

From the installation directory or the examples directory, run `fbc.exe examples\hello.bas` on Windows or DOS and `fbc hello.bas` on Linux, which produces the executable alongside the source, then run it. fbc is a command line compiler that is normally invoked by an IDE or a text editor, and the README is explicit that it is not a graphical code editor.

### Which packages do I need to build FreeBASIC programs on Linux?

On Debian and Ubuntu: gcc, libncurses5-dev, libffi-dev, libgl1-mesa-dev, libx11-dev, libxext-dev, libxrender-dev, libxrandr-dev, libxpm-dev, libtinfo5 and libgpm-dev. On Fedora: gcc, ncurses-devel, ncurses-compat-libs, libffi-devel, mesa-libGL-devel, libX11-devel, libXext-devel, libXrender-devel, libXrandr-devel and libXpm-devel.

### Can I ship a closed source program built with FreeBASIC?

The compiler fbc is GPLv2 or later, but the runtime libraries libfb, libfbgfx and their thread-safe versions are LGPLv2 or later with a special exception allowing you to link them with independent modules and distribute the resulting executable under terms of your choice, as long as you meet the licence terms of each linked independent module. The documentation is licensed under the GNU FDL.

## Sources

- [freebasic/fbc on GitHub](https://github.com/freebasic/fbc)
- [Issues](https://github.com/freebasic/fbc/issues)
- [Project website](https://www.freebasic.net)
- [README](https://github.com/freebasic/fbc/blob/master/README.md)
- [Releases](https://github.com/freebasic/fbc/releases)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/freebasic-fbc
