none
IntelliSense: PCH warning: Can not find a suitable header stop location. A PCH file wasn't generated.

    Question

  • Did anyone ever have this problem before? Here's a picture for clarification:

    I tried Googling this problem, but it seems it's unlikely to be found.

    EDIT:

    Forgot to mention my specs:

    Visual Studio 2010 Professional (DreamSpark Version), SP1 Beta

    Saturday, March 05, 2011 1:27 PM

Answers

  •  

    I reproduced this issue on my side: after applied SP1 beta, VS2010 shows me the PCH error message. We can ignore this error because it doesn't affect build phase, however, we cannot take advantage of intellisense.

     

    You can submit this issue to Microsoft Connect feedback portal http://connect.microsoft.com, Microsoft engineers will evaluate them seriously, thanks. If this issue is urgent, please contact support at http://support.microsoft.com.


    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by tom_mai78101 Wednesday, March 09, 2011 1:24 PM
    Wednesday, March 09, 2011 7:33 AM

All replies

  • Would please add the “#include "stdafx.h"  at the first line?
    Monday, March 07, 2011 9:52 AM
  • The project itself was created from the Project Wizard, with the Precompiled Header option unchecked, and Empty Project checked. So, I can't include "stdafx.h", since it doesn't exist.

    With that said, when I typed "#include <cstdio>", it's gone. So does any other C standard library header files.

    Before installing Visual Studio 2010 SP1 Beta, "void main(){}" actually worked, with no errors and no IntelliSense errors. Now why is it mandatory for me to add a header at the top when typing the code: "void main(){}"?

    Should I file a bug for this?

    Monday, March 07, 2011 12:53 PM
  • Hi Tom,

    This following MSDN blog discusses about the precompiled header files in Visual Studio 2010, you may want to have a look at it.

    http://blogs.msdn.com/b/vcblog/archive/2010/01/26/precompiled-header-files-in-visual-studio-2010.aspx

     

    Tuesday, March 08, 2011 2:04 AM
  •  

    I reproduced this issue on my side: after applied SP1 beta, VS2010 shows me the PCH error message. We can ignore this error because it doesn't affect build phase, however, we cannot take advantage of intellisense.

     

    You can submit this issue to Microsoft Connect feedback portal http://connect.microsoft.com, Microsoft engineers will evaluate them seriously, thanks. If this issue is urgent, please contact support at http://support.microsoft.com.


    Eric Yang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by tom_mai78101 Wednesday, March 09, 2011 1:24 PM
    Wednesday, March 09, 2011 7:33 AM
  • I have posted the issue up on Microsoft Connect.

    Link:

    https://connect.microsoft.com/VisualStudio/feedback/details/650359/intellisense-pch-warning-can-not-find-a-suitable-header-stop-location-a-pch-file-wasnt-generated

    Due to the Service Pack 1 is currently in Beta, I am not in a hurry. I will wait until the Service Pack 1 is ready to be released as Final 1.0.

    Wednesday, March 09, 2011 1:24 PM
  • You can fix this by setting your project to not use precompiled headers.  This seems to be turned on whether you ask for it or not.  Right click your project (not solution, but project) and click "Properties".  In the Project Property pages, look under "Configuration Properties", "C/C++", "Precompiled Headers".  Leaving the value blank is not sufficient.  You must select "Not Using Precompiled Headers".  Poof, problem goes away.
    Sunday, October 09, 2011 5:05 PM
  • You can fix this by setting your project to not use precompiled headers.  This seems to be turned on whether you ask for it or not.  Right click your project (not solution, but project) and click "Properties".  In the Project Property pages, look under "Configuration Properties", "C/C++", "Precompiled Headers".  Leaving the value blank is not sufficient.  You must select "Not Using Precompiled Headers".  Poof, problem goes away.

    I prefer your answer to my answer, except that it does not seem to work for me.

    I found that that putting anything with a # will also silence this particular IntelliSense warning.

    I put #pragma at the top of the file, without any arguments. Warning silences.

    #if 0

    #endif

    also silences the warning. This means that Visual Studio is not actually requiring an #include of a precompiled header. What Visual Studio is really requiring is a #. 


    Ron Lewis at Indinfer, Baltimore, Maryland, United States


    • Edited by Indinfer Friday, February 24, 2012 2:17 AM
    Friday, February 24, 2012 2:06 AM
  • Thanks for sharing this.

    Indeed including:

    # if 0

    # endif

    does make the issue go away. Do you have any idea why this is?

    Monday, September 09, 2013 7:00 PM
  • I supposed that this might be a design flaw. It is widely perceived that in C++, there will always be a hashtag sign (#) at the very top of the source code file, whether it be the header files or the source files.

    I don't know why it was designed this way. There could be comments, summaries, or possibly future Javadoc-similar variants (for C++17) that enables documentations within Intellisense that can be placed at the very top of the files.

    Friday, September 12, 2014 3:43 PM