Posts: 99
Threads: 26
Joined: Dec 2004
I took some advive and decided to try and learn FreeBasic, I have downloaded the compiler etc. but cannot get the examples to work or cannot make my own programs, I understand that it is only a FreeBasic compiler and was wandering who you go about making your own programs with FreeBasic.
Please Help
Posts: 1,439
Threads: 15
Joined: Apr 2003
`fbc filename.bas` produces 'filename.exe'
You'll need to use the command prompt or set up some Windows file associations to compile freeBASIC programs (or use vongodric's ide).
Posts: 99
Threads: 26
Joined: Dec 2004
Ok, I have downloaded the FBide but cannot figure out how to set it up, especially the syntax something or other but I do want to get it working as this project is a very good thing.
Posts: 306
Threads: 14
Joined: Nov 2002
Here's what I did and it works great. Install your FreeBASIC and then install the IDE to that folder. Once you've installed the IDE, I'd check the config file there to make sure the paths are set right, though I don't actually use the IDE to compile (there are still some kinks I believe). Anyways, get that going fine and then open up the IDE. Open up whatever example program you want or make your own quick program. To compile, I just click on Run->CMD Promt (misspelled for the time being) and type out the following:
cd.. (to get to the FBC directory)
fbc <.bas file> -e -g
(if the .bas file is in another directory, like the hello example, you'll wanna include the directory: fbc examples/hello.bas)
The latter two give error checking/debug info that will point you to what line you've screwed up in the source. Once that compiles, just type in the name of the .exe (which will default to the name of the .bas file you compiled). I just save my .bas files in the main fbc directory so I don't have to fool with directory names and changes.
If that doesn't work.. I'm not sure what you're doing. :wink:
Posts: 99
Threads: 26
Joined: Dec 2004
I did what you said and it worked great for the hello.bas but I couldn't get it to work for some of the others, should a window like qbasic be coming up with the code in it.
Posts: 3,279
Threads: 170
Joined: Nov 2003
I don't think ComDriver gets the point that fbc is a commandline compiler and has no built-in IDE...
I'd knock on wood, but my desk is particle board.
Posts: 1,272
Threads: 36
Joined: Feb 2003
ComDriver: fbc.exe doesn't let you edit or even look at your program, and it doesn't show a window. There's a separate program you can get for that call an IDE. There are 2, that I know of, being written to work with FreeBASIC. An IDE will be more familiar - a window where you can edit and test your code.
Posts: 3,279
Threads: 170
Joined: Nov 2003
Make that three...
:bounce:
I'd knock on wood, but my desk is particle board.
Posts: 99
Threads: 26
Joined: Dec 2004
Yes, I know that FBc is just a compiler but whenever I run a program using the command line a screen like Qbasic's creen cmes up. I know I'm slow but I really want to learn FreeBasic could someone please help.
Posts: 336
Threads: 4
Joined: Nov 2004
a screen like Qbasic is coming up that make no sence if your at command line then all you should see is a black box with C promt and from there you go fbc test.bas which will produce test.exe unless there error's in the source then the compiler will send back the error and the linenumber that error is at.