VStudio setting to see macro expansion?
-
I wrote a #define macro and I would like to see the output after it's preprocessed, is there a setting in VStudio that would show the macro after it is expanded? .dave. David Hisel -- http://www.hisel.com/
-
I wrote a #define macro and I would like to see the output after it's preprocessed, is there a setting in VStudio that would show the macro after it is expanded? .dave. David Hisel -- http://www.hisel.com/
From the Property Pages dialog:
- Expand the Configuration folder
- Expand the C/C++ folder
- Click the Preprocessor item
- Change the Generate Preprossed File to the desired setting (line numbers or not in the output file)
When you build the project, you will have preprocessed versions of your files with the .i extension. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
-
From the Property Pages dialog:
- Expand the Configuration folder
- Expand the C/C++ folder
- Click the Preprocessor item
- Change the Generate Preprossed File to the desired setting (line numbers or not in the output file)
When you build the project, you will have preprocessed versions of your files with the .i extension. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
-
sorry, but didn't find item 4 (line numbers or not). should I include some C++ macros there?
What do you see as options on the Preprocessor page? The third item should be labelled "Generate Preprocessed File". You click in that and drop the combo down to see the options. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
-
What do you see as options on the Preprocessor page? The third item should be labelled "Generate Preprocessed File". You click in that and drop the combo down to see the options. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
I did a Project->Settings->C/C++ -> Category: Preprocessor, and what I see is: Preprocessor definitions (edit box) UnDefined symbols: (check box, followed by an edit box) Additional include directories: (edit box) Ignore standard include paths (check box). What did I miss?
-
I did a Project->Settings->C/C++ -> Category: Preprocessor, and what I see is: Preprocessor definitions (edit box) UnDefined symbols: (check box, followed by an edit box) Additional include directories: (edit box) Ignore standard include paths (check box). What did I miss?
Oh. Are you running VS6? I'm running VS.NET. If you're running VS6, what you need to know is the following:
- Create preprocessor file - add /P to the CL call
- Create preprocessor file (with line numbers) - add /EP and /P to the CL call
Therefore, either look through for the pages for this option or manually add it. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
-
From the Property Pages dialog:
- Expand the Configuration folder
- Expand the C/C++ folder
- Click the Preprocessor item
- Change the Generate Preprossed File to the desired setting (line numbers or not in the output file)
When you build the project, you will have preprocessed versions of your files with the .i extension. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
the Property Pages, do you mean Project->Settings from the main menu? Also, I am using VStudio 6 Enterprise Edition, if that helps. .dave. David Hisel -- http://www.hisel.com/
-
the Property Pages, do you mean Project->Settings from the main menu? Also, I am using VStudio 6 Enterprise Edition, if that helps. .dave. David Hisel -- http://www.hisel.com/
Sorry. I use VS.NET and forget that most don't. Look at my response to Lucy where I explain (as well as I can withouut the VS6 environment installed) how to do this in VS6. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
-
Oh. Are you running VS6? I'm running VS.NET. If you're running VS6, what you need to know is the following:
- Create preprocessor file - add /P to the CL call
- Create preprocessor file (with line numbers) - add /EP and /P to the CL call
Therefore, either look through for the pages for this option or manually add it. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.
-
got it. Thank you, Tom. In VS6, it's add /P or /EP (output is the output window of VS6) in Project Options of Project->Settings->C/C++ ->Category: Preprocessor.
No problem, Lucy. This is tremendously valuable in learning how those magic MFC and ATL macros work. Cheers, Tom Archer Author, Inside C# A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the affairs of others.