The following applies to
fbc >= 1.09.0. fbc 1.09.0 introduced #cmdline. Before fbc 1.09.0 to write 32-bit or 64-bit code we had to point to the appropriate fbc in 'FBIde settings>FreeBASIC>Compiler path'. Rather than edit the 'Compiler path' one method was to have two folders containing FBIde - with one pointing to the 32-bit version of fbc and the other pointing to the 64-bit version of fbc.
Below is a method to access 32-bit or 64-bit without editing 'Compiler path' or using two folders.
If you have not already done so then download the combined 32-bit and 64-bit standalone versions of fbc from
Version 1.09.0 Released i.e. FreeBASIC-1.09.0-winlibs-gcc-9.3.0.7z.
In 'Compiler path' point to
fbc64.exe.
In your bas source, choose one of the following.
Code: Select all
#cmdline "-arch 686" => gas [1]
#cmdline "-gen gas64" => gas64 [2]
#cmdline "-arch 686 -gen gcc" => gcc 32-bit [3]
#cmdline "-gen gcc" => gcc 64-bit [4]
Needless to say, you may add to #cmdline as per your requirements.
For example:
Code: Select all
-w all -fpmode fast -fpu sse -arch 686 -gen gcc -O 2
The '-arch 686 -gen gcc' entries will give gcc 32-bit from [3] above.
So, the binary compiler invoked is via #cmdline.
Don't forget to point to
fbc64.exe in 'Compiler path'. Pointing to fbc32.exe will see [2] failing to compile and [4] will give 32-bit and not 64-bit; using 486.
That is it.
