Software Archive
Read-only legacy content
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
17060 Discussions

Cannot use macro in include '***.***'

Deleted_U_Intel
Employee
582 Views
I needs to use macro to redirect formatted write() to a all. It's OK when I put macro directly on the top of my source code. Because these large amount of macro need to be appeared in every file of my project, so I am trying to use comma in my source file to make it simple. Now the problem happens when the source code is complied.

In the source code, I have a sentence:


the contents in zzz.for are like:
 
#define WriteWinNF1(v1) if(nout.eq.nscr) then;WriteWinF1(v1);else;write(nout,*) v1;endif 
#define WriteWinNF2(v1,v2) if(nout.eq.nscr) then;WriteWinF2(v1,v2);else;write(nout,*) v1,v2;endif 
#define WriteWinNF3(v1,v2,v3) if(nout.eq.nscr) then;WriteWinF3(v1,v2,v3);else;write(nout,*) v1,v2,v3;endif 
#define WriteWinNF4(v1,v2,v3,v4) if(nout.eq.nscr) then;WriteWinF4(v1,v2,v3,v4);else;write(nout,*) v1,v2,v3,v4;endif 
#define WriteWinNF6(v1,v2,v3,v4,v5,v6) if(nout.eq.nscr) then;WriteWinF6(v1,v2,v3,v4,v5,v6);else;write(nout,*) v1,v2,v3,v4,v5,v6;endif 


There is no problem when the zzz.for is complied independently. But the original source has problem when been compiled.

Can some body provide some ideas?
Thank you in advance.
Jack
0 Kudos
2 Replies
Steven_L_Intel1
Employee
582 Views
See if this Knowledge Base article helps.

Steve
0 Kudos
Steven_L_Intel1
Employee
582 Views
Ah. You must use #include, not INCLUDE, for this. You need the macros to be seen by fpp, the preprocessor, and it will process only #include directives.

Steve
0 Kudos
Reply