HowTo: Install FreeBASIC into openSUSE 10.x, 11.x
Introduction: My old faithful, Fortran, doesn't cut the mustard for me in Suse, poor graphics. I could spend a year part time learning C/C++ to do the job, but I'm more concerned with getting jobs done now than with learning new tricks. I find that FreeBASIC, a very sophisticated open-source Basic language, suits me just fine. I recommend it. Maybe one day I'll progress to C, perhaps if I need to write an operating system, otherwise it's just not necessary.
Prerequisite packages: Open Yast Package Manager (at Yast --> Software Management) and use the search tool on the LHS to locate and install these packages.
I include the dependencies list for these packages only for my future reference, when openSUSE 12 is released.
Handbook: A comprehensive handbook in Windows compressed html help file format (.chm) is available from freeBASIC.net on this link. You can open the unzipped file, "FB-manual-etc.chm" with the KDE app KchmViewer, available on the install media.
Download & Install Compiler: You can download the compiler for Linux-x86, including libraries, headers, etc. without docs and sources from the freeBASIC download link. Unzip the FreeBASIC tar.gz file anywhere convenient.
Open a terminal/shell at the folder that contains the unzipped files and list them with ls -l: You should see a session like this, listing the downloaded files:
FreeBASIC compiler, fbc, is installed by executing the shell script "install.sh" with the command sudo ./install.sh -i in the open terminal. Simply answer the password question, supplying root's password when prompted, and in seconds the installation will complete. Here's a copy of the terminal session:
First Graphics Program, test.bas: You can test the compiler with a simple graphics programme that draws a few coloured lines etc. I'll list one that I know will work if installations of the prerequisite libraries and the fbc compiler all went OK. Open your favourite text editor, Gedit, Kwrite, whatever and paste these lines of code into it, then save as "test.bas":
Screen 13 will produce a graphics box of 320x200 px. Or 19->800x600, 20->1024x768, see "Screen (Graphics)" in the chm manual file.
Compile test.bas: To compile this (or any programme) into a C executable, issue command fbc test.bas in a normal user's terminal, being sure NOT to "su" to root privileges: . Here's the terminal session:
The warning message regarding `ospeed' is just a caution. It should be ignored. It occurs because the rt library I downloaded was compiled in Debian/Ubuntu Linux. It's not important.
Run test.bas: Just issue this shell command in a terminal: ./test and here's what you'll get:
Cheers
Swerdna mid 07; updated July 08