Recent

Author Topic: [solved]how to use debug mode option  (Read 253 times)

Packs

  • Sr. Member
  • ****
  • Posts: 364
[solved]how to use debug mode option
« on: November 07, 2024, 10:56:34 am »
{$IFDEF DEBUG}   

{$ELSE}   

 {$ENDIF} 

I have compile the application in debug mode still it is not working .
« Last Edit: November 07, 2024, 02:48:45 pm by Packs »

cdbc

  • Hero Member
  • *****
  • Posts: 1644
    • http://www.cdbc.dk
Re: how to use debug mode option
« Reply #1 on: November 07, 2024, 11:02:59 am »
Hi
You have to:
Code: Pascal  [Select][+][-]
  1. {$DEFINE DEBUG}
somewhere in your unit, before the 'ifdef's, for them to have effect.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

Fibonacci

  • Hero Member
  • *****
  • Posts: 594
  • Internal Error Hunter
Re: how to use debug mode option
« Reply #2 on: November 07, 2024, 11:08:34 am »
Go to Project Options and create release and debug modes, in debug mode add a custom option "-dDEBUG". A symbol defined with "-d" is visible in the whole project, not just in a unit like {$define ...}.

Packs

  • Sr. Member
  • ****
  • Posts: 364
Re: how to use debug mode option
« Reply #3 on: November 07, 2024, 02:28:35 pm »
Thank you sir 🙏

 

TinyPortal © 2005-2018