• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 291
  • Last Modified:

Where to call a INC file (that has compiler directives in it)?

Where to call a INC file that has compiler directives in it?

My INC file is like something like this:

{$DEFINE PreRelease}  
blabla    

{$IFDEF FinalRelease}
  {$OPTIMIZATION   ON}
{$ENDIF}
{$IFDEF PreRelease}
  {$OPTIMIZATION   OFF}
{$ENDIF}
blabla

Open in new window


I call this INC file in the DPR (before the main BEGIN END loop). However, the optimization is ON even if PreRelease is defined/active.
0
cubic77
Asked:
cubic77
  • 2
  • 2
1 Solution
 
Ephraim WangoyaCommented:
These are compiler directives, just put the file in the first line after interface on the unit that needs them

Unit1

interface

{$I compilers.inc}
0
 
cubic77Author Commented:
So, you mean I need to add them all over the place? I have quite few units there.
0
 
Ephraim WangoyaCommented:
Thats correct
0
 
Geert GOracle dbaCommented:
add them to each unit, yes

or define them in the project
0
 
cubic77Author Commented:
> or define them in the project

No. This is not working. This is actually what I am doing now: "I call this INC file in the DPR (before the main BEGIN END loop)."
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now