Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
Welcome to the Intel Community. If you get an answer you like, please mark it as an Accepted Solution to help others. Thank you!
26750 Discussions

illegal token on preprocessor directive line

Zhanghong_T_
Novice
198 Views

Dear all,

I am trying to compile code with defined preprocessor, however, it displayed 'illegal token on preprocessor directive line' when compiling. I have attached the test project. Could anyone help me to take a look at it?

Thanks,

Tang Laoya

0 Kudos
2 Replies
Lorri_M_Intel
Employee
198 Views

Your source files have unprintable characters on the same line as your preprocessor statements.   I saw this using a "vi"-like editor here.

What editor did you use to insert those preprocessor statements?    Or, did you simply cut-and-paste from an email or web site?  Sometimes that adds Unicode characters that you can't see with some text-based editors

I would remove the lines, and re-type them in your Visual Studio editor, especially if you'd copied them from an external source. 

Then try building again.

Finally, in case you ever need to report a problem again, in order to reproduce your failure in a Visual Studio solution, we need the .sln file and the .vfproj file.  The second file contains all the project settings and is helpful when trying to understand what command line options provoke an issue.  

The .suo file is not relevant.

                             --Lorri

 

Zhanghong_T_
Novice
198 Views

Dear Lorri,

Thank you very much for your kindly reply. Yes, it's exactly what you said. After removed the illegal characters, the project works.

Thanks,

Tang Laoya

Reply