Skip to content

Compiler Option G

Paul Squires edited this page Oct 14, 2026 · 3 revisions

Home › Compiler Option: -g

Compiler Option: -g

Add debug information, define __FB_DEBUG__, and enable asserts

Syntax

-g

Description

The -g compiler option inserts debugging symbols into output files, to use with GDB-compatible debuggers.

The intrinsic macro __FB_DEBUG__ is set to non-zero (-1) if the option was specified, and set to zero (0) otherwise.

Assert and AssertWarn macros are enabled.

Use of -g automatically implies -edebug, -edebuginfo, and -eassert, command line options.

__FB_ERR__ can be used to determine in user source code if the -g option was specified or implied on the command line.

See also


Reproduced from the FreeBASIC Wiki Manual under the GNU Free Documentation License 1.3 — with no Invariant Sections, no Front-Cover Texts and no Back-Cover Texts. Copyright © the FreeBASIC project and wiki contributors. See License.

Clone this wiki locally