CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2009
    Posts
    3

    Smile #pragma message not displaying

    I am sure this a compiler setting I have over looked. But can anyone tell me why my pragma message is not showing up in the build window?

    It has been years since I have tried to use this.

    Basic code as follows:

    Method ()
    {
    #pragma message ("Reminder here .....")
    }

    Init called the Method.

  2. #2
    Join Date
    May 2007
    Posts
    811

    Re: #pragma message not displaying

    I'm not sure I understood, but pragma message will output text message while you are compiling your source not at run time, and your syntax does look OK.

  3. #3
    Join Date
    Jun 2009
    Posts
    3

    Re: #pragma message not displaying

    From what I remember, "#pragma message ("some text") when compiling, it should display this message in the Build window. Is this correct?

  4. #4
    Join Date
    May 2007
    Posts
    811

    Re: #pragma message not displaying

    Quote Originally Posted by rkruis View Post
    From what I remember, "#pragma message ("some text") when compiling, it should display this message in the Build window. Is this correct?
    Yes, as pointed out in my post.
    "pragma message will output text message while you are compiling your source"

  5. #5
    Join Date
    Jun 2009
    Posts
    3

    Re: #pragma message not displaying

    Thanks STLDude.
    Any ideas what warning level should be set to, so this appears in my build window? I am sure it is a setting like that, that I have incorrect.

  6. #6
    Join Date
    May 2007
    Posts
    811

    Re: #pragma message not displaying

    This pragma message works with all warnings levels 1 to 4, so you should see it in Output window in Visual Studio. http://www.dr-bill.net/CSC076/class_...26/pragmas.htm for some more info.

  7. #7
    Join Date
    Jul 2007
    Posts
    2

    Re: #pragma message not displaying

    This is an old thread, but the problem is new for me...

    Just started using VS2012, and I'm having this same problem. The messages to not appear in the build window. Build errors appear, but not messages. I cannot find a switch in the options that might turn the display of these messages on.

  8. #8
    Join Date
    Feb 2003
    Location
    Iasi - Romania
    Posts
    8,234

    Re: #pragma message not displaying

    First, please further prefer opening a new thread instead of waking up a (very) old one!

    Well, I see two possible causes:
    1. it is skipped by other preprocessor directives: #if, #ifdef, etc;
    2. the project uses precompiled headers and you have put #pragma message before including "stdafx.h"; note that, in this case all preprocessor directives are ignored.
    Ovidiu
    "When in Rome, do as Romans do."
    My latest articles: https://codexpertro.wordpress.com/

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