# error with INCLUDE statement

**URL:** <https://forums.developer.nvidia.com/t/error-with-include-statement/132174>\
**Category:** Legacy PGI Compilers (archived)\
**Created:** [January 9, 2011, 2:26am UTC](https://forums.developer.nvidia.com/t/error-with-include-statement/132174 "2011-01-09T02:26:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tuan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Tuan](https://forums.developer.nvidia.com/u/Tuan)\
**Post date:** [January 9, 2011, 2:26am UTC](https://forums.developer.nvidia.com/t/error-with-include-statement/132174/1 "2011-01-09T02:26:50Z")

</div>

I want to use a separate file where I define the macro to help compiling my source files.  
The file is name “macro.h” (I tried with macro.f90) but the same error

```plaintext
!/* macro.f90 --- This file contains macro definition
! */

#ifndef INCLUDED_MACRO_H

#define INCLUDED_MACRO_H 1

#define FIXED_BOUNDARY 0
#define EULER_BOUNDARY 1

  ! use 1 all the time
#define _USE_LINEAR_FORM 1
  
  ! TUAN: only fixed-boundary is implemented
#define _BOUNDARY_CONDITION FIXED_BOUNDARY

  ! 0 = no CUDA/OpenGL
  ! 1 = use 
#define _USE_DISPLAY_ 0
  

#endif
  !/* INCLUDED_MACRO_H */

```

In the Fortran code, I use the INCLUDE statement

```plaintext
MODULE mycode
  INCLUDE "macro.h"

CONTAINS
  subroutine myfunc()

  end subroutine

END MODULE

```

And when I try to compile the code, I get the following error

> PGF90-S-0021-Label field of continuation line is not blank (./macro.f90: 4)  
> PGF90-S-0021-Label field of continuation line is not blank (./macro.f90: 6)  
> PGF90-S-0021-Label field of continuation line is not blank (./macro.f90: 8)  
> PGF90-S-0021-Label field of continuation line is not blank (./macro.f90: 9)  
> PGF90-S-0021-Label field of continuation line is not blank (./macro.f90: 12)  
> PGF90-S-0021-Label field of continuation line is not blank (./macro.f90: 15)  
> PGF90-S-0021-Label field of continuation line is not blank (./macro.f90: 20)  
> PGF90-S-0021-Label field of continuation line is not blank (./macro.f90: 23)

If I copy the whole file content and paste directly to the fortran source file, then there is no problem. I’m using Fortran 10.9, Ubuntu 64x.

NOTE: I already use -Mpreprocess in the compiler options.

Tuan

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [January 10, 2011, 9:55pm UTC](https://forums.developer.nvidia.com/t/error-with-include-statement/132174/2 "2011-01-10T21:55:54Z")

</div>

Hi Tuan,

Try using the C preprocessor (-Mcpp) instead of the Fortran preprocessor (-Mpreprocess) for these C macros.

For example:

```nohighlight
% pgf90 -c macro.f90 -Mpreprocess
PGF90-S-0021-Label field of continuation line is not blank (./macro.h: 4)
PGF90-S-0021-Label field of continuation line is not blank (./macro.h: 6)
PGF90-S-0021-Label field of continuation line is not blank (./macro.h: 8)
PGF90-S-0021-Label field of continuation line is not blank (./macro.h: 9)
PGF90-S-0021-Label field of continuation line is not blank (./macro.h: 12)
PGF90-S-0021-Label field of continuation line is not blank (./macro.h: 15)
PGF90-S-0021-Label field of continuation line is not blank (./macro.h: 20)
PGF90-S-0021-Label field of continuation line is not blank (./macro.h: 23)
  0 inform, 0 warnings, 8 severes, 0 fatal for mycode
% pgf90 -c macro.f90 -Mcpp 
%

```

Hope this helps and Go Ducks!  
Mat

---

<div class="post-metadata">

**Author:** ![Tuan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Tuan](https://forums.developer.nvidia.com/u/Tuan)\
**Post date:** [January 31, 2011, 11:36pm UTC](https://forums.developer.nvidia.com/t/error-with-include-statement/132174/3 "2011-01-31T23:36:36Z")

</div>

> [@mkcolg](#):
>
> Hi Tuan,
> 
> Try using the C preprocessor (-Mcpp) instead of the Fortran preprocessor (-Mpreprocess) for these C macros.
> 
> Hope this helps and Go Ducks!  
> Mat

Hi Mat,  
I tried and it seems the only thing the compiler does is to generate a file with .f extension, ie. a file macro.f, and no other compilation process is done. Could you please check?

Tuan

---

<div class="post-metadata">

**Author:** ![MatColgrove](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/matcolgrove/32/14047_2.png) [@MatColgrove](https://forums.developer.nvidia.com/u/MatColgrove)\
**Post date:** [February 1, 2011, 12:24am UTC](https://forums.developer.nvidia.com/t/error-with-include-statement/132174/4 "2011-02-01T00:24:45Z")

</div>

Hi Tuan,

Ugh, I guess I had my mind on the BCS Championship game. Sorry.

Change “INCLUDE” to “#include” to use the C style preprocessing.

> % cat macro.f90
> 
> MODULE mycode  
> #include “macro.h”
> 
> CONTAINS  
> subroutine myfunc()  
> end subroutine
> 
> END MODULE  
> % pgf90 macro.f90 -Mpreprocess -c  
> %

- Mat

---

<div class="post-metadata">

**Author:** ![Tuan](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Tuan](https://forums.developer.nvidia.com/u/Tuan)\
**Post date:** [February 1, 2011, 4:37am UTC](https://forums.developer.nvidia.com/t/error-with-include-statement/132174/5 "2011-02-01T04:37:53Z")

</div>

Great, it works now.

Thanks a lot Mat.

Tuan
