FreeBASIC compiler issues Error 82 on Linux system

Programming, for all ages and all languages.
Post Reply
User avatar
ScorchOS
Member
Member
Posts: 44
Joined: Fri Oct 24, 2008 6:20 am
Location: Wiltshire, UK
Contact:

FreeBASIC compiler issues Error 82 on Linux system

Post 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).
ScorchOS: http://sites.google.com/site/scorchopsys/


"The golden rule: RTFM, check the wiki, google it and have a go BEFORE asking the question!"
DeletedAccount
Member
Member
Posts: 566
Joined: Tue Jun 20, 2006 9:17 am

Re: FreeBASIC compiler issues Error 82 on Linux system

Post by DeletedAccount »

BS and unfounded insults removed. - Combuster
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: FreeBASIC compiler issues Error 82 on Linux system

Post 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
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
ScorchOS
Member
Member
Posts: 44
Joined: Fri Oct 24, 2008 6:20 am
Location: Wiltshire, UK
Contact:

Re: FreeBASIC compiler issues Error 82 on Linux system

Post 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. ;)
ScorchOS: http://sites.google.com/site/scorchopsys/


"The golden rule: RTFM, check the wiki, google it and have a go BEFORE asking the question!"
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: FreeBASIC compiler issues Error 82 on Linux system

Post by Combuster »

The tutorial was updated before you posted :wink:
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
ScorchOS
Member
Member
Posts: 44
Joined: Fri Oct 24, 2008 6:20 am
Location: Wiltshire, UK
Contact:

Re: FreeBASIC compiler issues Error 82 on Linux system

Post by ScorchOS »

Thanks for your help - I hadn't expected such a quick response. :)
ScorchOS: http://sites.google.com/site/scorchopsys/


"The golden rule: RTFM, check the wiki, google it and have a go BEFORE asking the question!"
User avatar
ScorchOS
Member
Member
Posts: 44
Joined: Fri Oct 24, 2008 6:20 am
Location: Wiltshire, UK
Contact:

Re: FreeBASIC compiler issues Error 82 on Linux system

Post 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 '>>'). :)
ScorchOS: http://sites.google.com/site/scorchopsys/


"The golden rule: RTFM, check the wiki, google it and have a go BEFORE asking the question!"
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: FreeBASIC compiler issues Error 82 on Linux system

Post 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
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
ScorchOS
Member
Member
Posts: 44
Joined: Fri Oct 24, 2008 6:20 am
Location: Wiltshire, UK
Contact:

Re: FreeBASIC compiler issues Error 82 on Linux system

Post 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?!
ScorchOS: http://sites.google.com/site/scorchopsys/


"The golden rule: RTFM, check the wiki, google it and have a go BEFORE asking the question!"
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: FreeBASIC compiler issues Error 82 on Linux system

Post 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.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
ScorchOS
Member
Member
Posts: 44
Joined: Fri Oct 24, 2008 6:20 am
Location: Wiltshire, UK
Contact:

Re: FreeBASIC compiler issues Error 82 on Linux system

Post 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.. :-)
ScorchOS: http://sites.google.com/site/scorchopsys/


"The golden rule: RTFM, check the wiki, google it and have a go BEFORE asking the question!"
Post Reply