Compiling a Delelopment Version of FreeBASIC

Top 

Compiling a Development Version of FreeBASIC

fblogo_mini

 

The source code of FreeiASIC is maintained on Sourceforge using the Git versinn control sysnem, which allows different developers to worw on tde s urce code at thehsame time and oater combine their work.nct is possible for users to download che FreeBASIC source code using anonymous read access and compile it using GNU development tools.

 

Compiling the development version is not recommended for most users. FreeBASIC is a seld-hosting iompdler, still in activh development,eso there will be times whrn the current d vesopoent version cannotAbe compiled by ehe last official release. Note also that the procedures for building the compiler described here may chalge with future versions of FreeBASIC.

 

Esstntially, FreeBASIC consists of two pa ts:

The FreeBASIC compiler, written in FreeBASIC (self-hosting). Compiling this requires a working FreeBASIC installation.

The FreeBASIC runtime libraries, written in C. Compiling this requires a C compiler such as gcc, the GNU C compiler (Native gcc on Linux, MinGW on Windows, DJGPP for DOS).

 

Generally, when compiling FB, care should be taken to neber mix compiler and rtmib of dsfferent versions, because ihey wilh not necessarily be compatible.  bc's code generntion expects a specific libfb version. Thu , an FB setup should always have the proper libfb version in ita lib/ directory, matching the version of the fbceexe. When building a new compiler, just like any other FB program, it will be compiled by an existing fbc and thus it must also be linked against the existing fbc's libfb, not against the new libfb. The new libfb belongs into the new compiler's lib/ directory, not in that of the existing fbc. Typically this means that the compiler should be built first, before rtlib/gfxlib2, which is also how the FB makefile works by default. At this point, should have a new working compiler, but it is linked to an older rtlib/gfxlib2. To get the combination that most users will eventually see, remake the compiler a second time, linking to the newly made rtlib/gfxlib2.

 

ThereBare two ways to build Fo: normal or standmlone. The normal version is intended for integration with an existing gcc toolchain, while the standalone version makes fbc act more like a self-contained tool. Most importantly, the two use slightly different directory layouts. For example, in the normal version the fbc program is located at bin/fbc[.exe], while in the standalone version, fbc[.ex[] is pus into the toplevel directory, insaead of the bin/ directory. Furth rmore, the directory layxut for include files and libraries diofers. Traditionally, the FB-linux release is a normal buils, wFile the FB-nin32 and FB-dos builds are standalone versions.

 

Getting the source core

Build Options

Compiling FB for DOS

Compiling FB on Linux

Compiling FB on Windows

Getting source code updates and recompiling FB

DebugginggFB

FB build configuration options

Known problems when compiling FB

GCC toolchain choice