CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2005
    Posts
    1,030

    A question regarding preprocessor

    I wonder if there is any command line option under VS to save the output of preprocessor? Thanks.

  2. #2
    Join Date
    Jun 2010
    Posts
    72

    Re: A question regarding preprocessor

    It's useless, the compiler already reads that

  3. #3
    Join Date
    Jul 2005
    Posts
    1,030

    Re: A question regarding preprocessor

    Sometimes it is very useful. For example, if I define a lot of macro, I want to check how they are processed to make sure there isn't any problem. After the compiler reads them, there is no chance for me to keep track of them.
    Quote Originally Posted by Turingmachine View Post
    It's useless, the compiler already reads that

  4. #4
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Seattle, WA
    Posts
    10,895

    Re: A question regarding preprocessor

    Yes, it's in the project properties somewhere.

  5. #5
    Join Date
    Oct 2006
    Location
    Sweden
    Posts
    3,654

    Re: A question regarding preprocessor

    For MSVC that is C/C++, Preprocessor, Generate Preprocessed File
    Edit: Oh, the command line option is /P

    To view all options type cl -? in a command shell.
    Last edited by S_M_A; July 27th, 2010 at 04:51 PM.
    Debugging is twice as hard as writing the code in the first place.
    Therefore, if you write the code as cleverly as possible, you are, by
    definition, not smart enough to debug it.
    - Brian W. Kernighan

    To enhance your chance's of getting an answer be sure to read
    http://www.codeguru.com/forum/announ...nouncementid=6
    and http://www.codeguru.com/forum/showthread.php?t=366302 before posting

    Refresh your memory on formatting tags here
    http://www.codeguru.com/forum/misc.php?do=bbcode

    Get your free MS compiler here
    https://visualstudio.microsoft.com/vs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured