http://wiki.osdev.org/FreeBASIC
Code: Select all
A normal install of FreeBasic is in most cases configured to build for the system it was installed on. That means that it will try to compile programs for linux or windows OSes, rather than your own.
To fix this, you should build at the very least a crosscompiling binutils (2.17 or later recommended). While you're at it, you can also build GCC, which comes in handy once you start porting software written in C (that includes the runtime).
FreeBasic stores its auxiliary binaries in the bin directory, or a subdirectory thereof. To get started quickly, replace ld, ar and as with the versions built in the previous step. Note that this stops FreeBasic from working on its previous host. Under windows, the bin directory is subdivided into platforms, and you can add a new one rather than modifying the existing one. To use this, create the 'linux' directory, copy i586-elf-ld, i586-elf-ar and i586-elf-as, and rename them to ld, ar and as. When running freebasic you can use the -t linux command line switch to compile for your OS instead of windows, allowing you to continue using Freebasic normally for non-os development. The Linux version does not come with this target switch - here you'll have to replace the bundled binaries with your own versions.