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?
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.