When compiling with the '-r' switch under DOS, Win32, or Win64 (and presumably other systems), FB_ARGC and FB_ARGV are not defined, but when omitting '-r' they are:
D:\Win64tools\Programming\FreeBASIC>type tst.bas print __FB_ARGC__ print *__FB_ARGV__[0] D:\Win64tools\Programming\FreeBASIC>fbc64 -version FreeBASIC Compiler - Version 1.10.1 (2023-12-24), built for win64 (64bit) Copyright (C) 2004-2023 The FreeBASIC development team. standalone D:\Win64tools\Programming\FreeBASIC>fbc64 tst.bas D:\Win64tools\Programming\FreeBASIC>tst.exe 1 tst.exe D:\Win64tools\Programming\FreeBASIC>fbc64 -r tst.bas tst.bas(1) error 42: Variable not declared, __FB_ARGC__ in 'print __FB_ARGC__' tst.bas(2) error 42: Variable not declared, __FB_ARGV__ in 'print *__FB_ARGV__[0]'
Try:
fbc64 -r tst.bas -m tstSee:
-r option
And see also: -m option, __FB_ARGC__
__FB_ARGC__and__FB_ARGV__are defined for the implicit main function in the main module only.-roption overrides fbc's normal decision making about what to build and therefore fbc will not automatically infer that the module to translate is a main module.Ah, I apologize. I never noticed that bit about '-m' before. Sorry for the inaccurate report.
Thank-you for the report!