ZortMcGort11 Posted May 3, 2014 Posted May 3, 2014 (edited) I decided to try out the FreeBASIC compiler (DOS version) which is found here:http://freebasic.net/getAnyway, can't seem to get my .bas files to compile into executables using this thing. I keep getting an error message that I didn't declare my variables.For example, when it debugs my code, it says:Error 41: Variable not declared, D in "for d = 4 to 78."And then it has a problem with my string variables too.Error 139: Suffixes are only valid in -lang deprecated or fblite or qb, found 'Choice' in "Choice$ = UCASE$(INKEY$)"And the final nail in the coffin:error 125: too many errors existing^ Gee, thanks LOL.The funny thing is my code runs fine in the QBasic 1.1 interpreter, and I have sucessfuly compiled this same source using QuickBasic 4.5.I must be missing something with this FreeBasic thing. I wonder if anyone around here has used FreeBASIC to compile programs? Edited May 3, 2014 by LostInSpace2012
ZortMcGort11 Posted May 3, 2014 Author Posted May 3, 2014 (edited) stupid me!Oh, I figured it out. Apparently FreeBASIC can compile using several different dialects. Error 139 was the key. Since it doesn't autodetect which BASIC dialect you're inputing, you need to tell it by adding an argument on the command line...So, when you input a QuickBasic source file into the FreeBASIC compiler, you must use the following command argument:FBC -lang qb world.basMy guitar program successfully compiled. Yay!Here's an another example, you can save the following code as world.bas, then compile it into an .exe file. clsprint "hello world"endNow, you'll have a really lame "Hello World" DOS exe file.*Edit*I posted the code to my DOS Clock, but the javascript messed up all the variables and strings, so I put up the easiest program known to man, the Hello World Program :-)Maybe this will spare somebody an hour of confusion trying to figure out the FBC compiler. Edited May 3, 2014 by LostInSpace2012
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now