#pragma and -e or -exx

New to FreeBASIC? Post your questions here.
Post Reply
grausvic
Posts: 6
Joined: Jun 07, 2019 10:34

#pragma and -e or -exx

Post by grausvic »

I'm trying to compile instructions (written inside a program) like:

#pragma -exx
#pragma "-exx"
#pragma cmdline=-exx
#pragma cmdline="-exx"

...but they don't work, an error is shown when compiling. How can I use these instructions (I mean -exx) inside a FreeBasic program?
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: #pragma and -e or -exx

Post by MrSwiss »

How can I use these instructions (I mean -exx) inside a FreeBasic program?
Simple, you don't ... (except, maybe #Pragma Once, in a *.bi file).
Those are Command Line Arguments for the Compiler itself (FBC).

See documentation: FreeBASIC Manual
Specifically, FBC Command Line Options: Compiler Options
grausvic
Posts: 6
Joined: Jun 07, 2019 10:34

Re: #pragma and -e or -exx

Post by grausvic »

I see. My specific problem was that I couldn't find how to tell my editor to compile with the -exx option (even if I found it, my syntax was wrong).
And I thought that, as well as you can use things like #lang and many others inside your program, you could write something like #-exx or #pragma -exx or whatever.
It's curious: unless I'm wrong, there is an asymmetry between command options like -lang and others like -exx, so for the beginner it's a bit confusing, specially if you have problems with your IDE (editor associated with FreeBasic).
Now everything is O.K, I finally found how to work it out with my editor.
I hope this mini-post serves to any beginner having the same problem: you must insist, re-read you editor's instructions many times, retry, ...
Post Reply