Page 1 of 1

FreeBASIC compiler issues Error 82 on Linux system

Posted: Sat May 23, 2009 6:31 am
by ScorchOS
I'm following the barebones tutorial to create a minimal kernel in FreeBASIC and build on it, but I'm having issues with the compiler.

While using the string:

Code: Select all

fbc -c -o kernel.o kernel.bas
I get the following error:

Code: Select all

error 82: Missing command-line option for, "-o"
I've tried this with the native as, ld, etc. and with the cross-compiled ones and still no joy. On removing the '-o' option I get the error:

Code: Select all

kernel.asm: Assembler messages:
kernel.asm:17: Error: undefined symbol `PIPE' in operation
I have a good knowledge of FreeBASIC, but I am unsure as to why the <PIPE> token is used in the tutorial (and therefore can't figure out a code work-around)

If anyone else has experience this problem and found a solution, I would be very grateful! (I'm running Ubuntu Intrepid and I have tried both the standalone and standard FreeBASIC packages).

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Sat May 23, 2009 11:55 am
by DeletedAccount
BS and unfounded insults removed. - Combuster

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Sat May 23, 2009 12:34 pm
by Combuster
@Shrek: DO NOT POST (NONSENSE) WHEN YOU DO NOT KNOW WHAT YOU ARE TALKING ABOUT

I wrote and tested the tutorial a while back, using Freebasic 0.16. In the meantime i'm up to 0.20 and several things have changed. I have updated the compiler and runtime in my own project with few problems (mainly the preprocessor). using -c -o apparently does not work anymore (shame on the devs) and the method my makefile uses is to

Code: Select all

fbc -c file.bas -o file.o
I just checked on my dev machine and that should fix that problem (be fixing that shortly in the tutorial)

I'm looking at the <pipe> thing - looks like the syntax highlighter messed that up since it doesn't exist in the source. (be fixing that shortly as well)

Let me know if it works now

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Sat May 23, 2009 5:44 pm
by ScorchOS
Thanks for the help! Yes, your solution does work and I no longer get the Error 82 message (I'm almost gutted the solution was so simple!). The only thing preventing the compile now is the '<PIPE>' error, so I look forward to the next update to the tutorial :)

Sorry for being slow to respond. On the upside, I think I may have missed the response you blocked. ;)

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Sun May 24, 2009 3:14 am
by Combuster
The tutorial was updated before you posted :wink:

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Sun May 24, 2009 3:40 am
by ScorchOS
Thanks for your help - I hadn't expected such a quick response. :)

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Mon May 25, 2009 1:57 pm
by ScorchOS
As an aside, what has your experience been of trying to get bitwise shifts working in FreeBASIC?

I've been using the SHL and SHR operators (which works with desktop apps though I haven't yet tried it with my kernel GDT), but is there a more orthodox method in FreeBASIC? It could just be that I'm thinking in terms of C (where you simply use '<<' or '>>'). :)

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Mon May 25, 2009 2:06 pm
by Combuster
SHL and SHR are not native basic, and even then, they are more basic than << or >> would be. Remember its not meant to be "unreadable" like c

Still if you're looking for the true BASIC way, you can always multiply or divide by 2,4,8,16,32,... :D

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Mon May 25, 2009 3:16 pm
by ScorchOS
lol :D I'm still transitioning from a C/VB.NET background so it seems a little odd to have near-English sounding syntax.

As a final, final aside, I'm presently trying to pass a reference in FreeBASIC. More specifically, I've been trying to pass the reference of an array into a variable as part of a GDT setup routine.
C Sample code:

Code: Select all

Type.variable = &refOfAnotherVariable
I've tried the 'addressof' ('@') operator, but I suspect this produces a pointer as it keeps asking for an array index. Am I once again trying to do something in a C-style way?!

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Tue May 26, 2009 1:59 am
by Combuster
If you want a C style pointer to an array, use @(array(0)). But do consider if the ByRef keyword is more suitable for what you want.

Re: FreeBASIC compiler issues Error 82 on Linux system

Posted: Tue May 26, 2009 3:08 am
by ScorchOS
Thanks for your help. I'll give ByRef a go, but failing that I will use a C-style pointer. When you use a language it's always better to use native syntax than to try and emulate another one.. :-)