Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Conditional compilation

w_a_kramer
Beginner
962 Views
Hello,

Why doesn't the following code function?
  
  !DEC$ IF DEFINED ($DLL)
    USE DllGlobals
  !DEC$ ENDIF


whereas

  !DEC$ IF DEFINED($DLL)
    iGuarantee=0
  !DEC$ ENDIF


functions OK.

The conditional compilation seems to be completely ignored for use statements.
Even if $DLL is not defined the compiler starts complaining about not finding the DllGlobal.mod file.

Walter Kramer
0 Kudos
2 Replies
Jugoslav_Dujic
Valued Contributor II
962 Views
No, it works in both cases. You're probably confused by the complaints about "Cannot find DllGlobals.mod" -- these come from dependency analyser, which scans source files to build dependency tree before any actual compiling. These messages are benign -- compiler will not actually USE the module.
0 Kudos
Steven_L_Intel1
Employee
962 Views
Let me warn you, however, that the !DEC$ IF style of conditional compilation operates on a per-statement mode, not per-line as you might think. You can't use !DEC$ IF to conditionally add to or subtract from part of a statement.

Steve
0 Kudos
Reply