1

I want to install freeBASIC on ubuntu( to code QBASIC). There is a package "libfreebasic" which I've installed but I don't see any difference on my system... Can I code in QBASIC in ubuntu?

4 Answers 4

3

You can use QB64 as an IDE if you want to use QBASIC. (Yes, it does work on 32 bit platforms.)

In case you want to stick with FreeBASIC, you will need to install a few dependencies. Also, it's only a compiler, so you will need to create scripts using a text editor of your choice, then compile and execute them from a terminal, like so:

$ fbc -lang qb example.bas
$ ./example

Installing depndencies

Source: http://www.freebasic.net/wiki/wikka.php?wakka=CompilerInstalling

32 bit

$ sudo apt-get install gcc g++ libncurses5-dev libx11-dev libxext-dev libxrender-dev libxrandr-dev libxpm-dev libffi-dev 

64 bit

$ sudo apt-get install gcc-multilib g++-multilib lib32ncurses5-dev libx11-dev:i386 libxext-dev:i386 libxrender-dev:i386 libxrandr-dev:i386 libxpm-dev:i386 

Installing FreeBASIC

$ wget 'http://sourceforge.net/projects/fbc/files/Binaries%20-%20Linux/FreeBASIC-0.90.1-linux.tar.gz/download?download=#' -O FreeBASIC-0.90.1-linux.tar.gz
$ tar -xf FreeBASIC-0.90.1-linux.tar.gz
$ cd FreeBASIC-0.90.1-linux
$ sudo ./install.sh
1

What you are looking for is a BASIC interpreter. You can code BASIC on any text editor. According to this post, the procedure you should follow is:

  1. Get Qbasic.exe from microsoft
  2. Install dosemu: sudo apt-get install dosemu
  3. Right click on Qbasic.exe and "open with dosemu"

The real question, of course, is why in the world would you want to code BASIC? Even if you do have a valid reason for this, why in the world would you want to code BASIC in a Linux environment? There are many interpreted languages that are already integrated or for which it is very easy to install interpreters in the *ix world. The list includes, but is not limited to, Perl, Python, BASH, TCSH, Ruby, Lisp...

4
  • Well, I definitely would not recommend bash, tcsh, or perl as first programming languages.
    – Peon
    Jan 24, 2014 at 19:05
  • 1
    @Peon that's your prerogative but I just listed some of the more famous scripting languages that are natively available on *nix. Anyway, my first language was Perl but who said anything about first languages?
    – terdon
    Jan 24, 2014 at 19:07
  • 1
    I learnt qbasic when I was a child, 25 years ago. I want to program with it again today and I only have Linux. That Is my reason
    – Robert
    Apr 1, 2017 at 22:08
  • @Robert in that case, I would strongly urge you to learn another. While you can use basic in Linux, it will be needlessly hard and it isn't a very useful language anyway. Having learned one, learning a second is not too hard, so you really should consider something like python. Your choice, of course, but it really isn't a very relevant language these days.
    – terdon
    Apr 1, 2017 at 23:43
0

If you're looking for a full IDE specifically for QBasic, I don't think you'll find one. FreeBASIC is a compiler, which claims to be compatible with QBasic, but you don't use it for actually writing applications. You can write your BASIC applications in whatever text editor or IDE you'd like (I recommend Emacs, others may recommend Vim, Eclipse, or something else). Once you've written the application in the editor of your choice, you can use FreeBASIC to compile it on your machine.

However, you really might want to consider options other than QBasic. If you're set on using some form of Basic, you can use VB.Net, and compile it using the Mono VB.Net compiler. You could also try Gambas, RealBASIC, KBasic, etc.

0

When this question was written, free and friendly virtualized or emulated environments left a lot to be desired.

Now, however, I recommend hosting a virtual machine. VirtualBox (free, runs GREAT on linux) just released v6.0.2, and FreeDOS 1.1 (free) is a VM you can slot right in there. Turnkey stuff.

I now have several versions of quickbasic/QBasic (from my old collection of very old files) including 4.5 and 7.1 on that virtual machine, as well the FreeBASIC compiler (free), WordStar (I own a boxed copy with floppies and manual right on my shelf), and a bunch of stuff I downloaded through the package manager in FreeDOS called FDIMPLES.EXE.

While I recommend FreeDOS for its best-of-both-worlds approach to fidelity and modernity, I am also using a MS-DOS 6.22 (again, got the disks in a box) virtual machine. So far, I have found no compatibility differences between them. Of note: WordStar saves! If you know why that's notable, you're probably already downloading.

I am hosting these VMs on Oracle VirtualBox on my Windows machine, but with whole-machine virtualization this good, it doesn't matter what the actual OS running on your hardware is, so long as it is supported by VirtualBox.

VMWare is another publisher of a virtualization host, but I am not familiar with it.

I think that this answers the spirit of the question, as well as the technical merit. The one thing that this solution does not do is leave you immersed in Linux while coding -- you can't grep awk sed chop slice your file as it sits -- you will be immersed in DOS, and frankly will have to work to get some cross-system file-sharing going on. However, being on Linux, a stable, modern FTP server should be trivial, and the FreeDOS VM actually can be set up to run its own FTP server (FTPSERV.EXE, of course) so that you can push files to it while sitting in the host (in your case Linux) environment. hits the sweet spot for grabbing a file from the web and putting it where you want it, instead of having to play the where-did-I-put-that-thing game in the VM.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .