Getting FreeBasic

(Redirected from Getting Freebasic)
Jump to navigationJump to search

FreeBasic is a 32/64-bit, cross-platform, QuickBasic compatible, modern object-orientated language in the BASIC family. This page will talk about getting and installing it on each of the platforms of OHRRPGCE Development. DOS32 is not supported by the OHR (actually, noone has ever tried it).

The latest version of FreeBasic is recommended (at least 1.04 is strongly recommended, and at least 1.00 is required). Certain ports require forks of FB 1.06 (as yet unmerged and unreleased).


On Windows for FB 0.90+ there are two different builds of FreeBASIC provided: one compatible with MingGW, and one compatible with MinGW-w64. The default installer is compatible with MinGW-w64. The MinGW alternative is called a "mingw32" or "mingworg" build. (The mingw build doesn't duplicate binaries and libraries included with MinGW.) You need to install a version of FB compatible with the distribution of mingw/mingw-w64 you install; see Windows compiling requirements.

There are also 64 bit versions of FB. I expect these would still be capable of creating 32 bit executables, but whether they work with the OHR is completely untested.

Note that the zip distributions of FreeBasic will not automatically add the location of fbc.exe to the system's PATH. You should not extract the files overwriting an existing install of the FreeBasic installer into C:\Program Files (x86)\FreeBASIC\ because the PATH set up by that installer may not be correct.

If you extracted FreeBASIC at (e.g.) C:\Program Files (x86)\FreeBASIC\, then you need to put both C:\Program Files (x86)\FreeBASIC\ and C:\Program Files (x86)\FreeBASIC\bin\win32 in your PATH. For other versions of FB, the necessary PATH varies.


Download and install one of the freebasic packages from Note that the OHR scons build system currently defaults to creating 32 bit binaries because it better tested; to build 64 bit binaries instead add arch=64, e.g. scons -j4 arch=64. See Compiling 64-bit builds.

See also Linux library requirements.

Standalone vs. Normal builds[edit]

For recent versions, this distinction is only relevant if compiling FB yourself. Previously FB packages were available in both 'standalone' and 'normal' versions. Now only normal builds are distributed.

If compiling you should never create a standalone build, regardless of whether you install FB globally on your system or not. The way standalone builds work has changed in recent FB versions, so that it now expects gcc, as, etc, in its local bin/ directory and does not look on the $PATH. This seems to be intended only for distributing packages to Windows users.

See also the FB wiki page on Normal vs. Standalone FreeBASIC installs.


See Compiling in Mac OS X.


See Compiling for Android‎.

FreeBSD and others[edit]

The OHRRPGCE has recently been confirmed to work on FreeBSD. FB does also kind-of support NetBSD and OpenBSD, but you're on your own. (FB's Unix headers aren't portable or complete, so for OpenBSD etc. it's likely you will have to edit the "crt" headers in some places where there are OS-specific defines.)

Old builds of FB for FreeBSD are available on the FB forums, but probably won't work due to missing headers.

For the moment you need to use a fork of FB 1.06 which fixes FreeBSD support.

FB is written in FB. Unlike cross-compiling, it's easy to compile FB yourself, see #Compiling bootstrapped FreeBASIC (includes the FreeBSD fixes). You don't need a copy of the above git repo.

ARM (e.g. Raspberry Pi)[edit]

There's no official package for linux on arm. Someone has created packages here.

Alternatively, you can compile it, see below.

Compiling bootstrapped FreeBASIC[edit]

FreeBASIC packages aren't available for every OS it supports. You can compile FB yourself using a 'bootstrap' distribution of the FB source, which is a copy of the source code with the FB's compiler FB source code pre-translated to C for the appropriate targets, so that you can compile FB without an existing copy of FB.

Such a pre-generated bootstrap is available for linux-arm (armhf), freebsd-x86 and freebsd-x86_64. (Or you can easily generate it yourself from a copy o f the FB source, if fbc is already installed: just run "make bootstrap-dist". You'd likely want to edit the makefile to control which OSes are targeted.)

Requires GCC, and GNU Make on FreeBSD.

  • Download and extract (contains linux-arm (armhf), freebsd-x86 and freebsd-x86_64).
  • Run "make bootstrap" (or "gmake bootstrap" on FreeBSD) (Hint: add "-j4" for 4-core CPUs, etc)
  • Install it somewhere (this is necessary to get the right directory structure). Either system wide with e.g. "sudo make install prefix=/usr/local" (that's the default prefix so can be omitetd), or locally, e.g. "make install prefix=~/local/fbc-1.06"
  • Either make sure the installed $prefix/bin/fbc is in your $PATH, or compile the OHR with "scons fbc=/path/to/bin/fbc"

See Also[edit]