Re: VC2005 Pro: IDE (Compiler ?) can't find Stdafx.h



See below inline -

David

"Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp> wrote in message
news:Os9U3BqCGHA.3784@xxxxxxxxxxxxxxxxxxxxxxx
> David F wrote:
> > I understand well what you say and what Scott wrote but how
> > does it correlate with the facts I wrote about and repeat here:
> > 1. I did not setup up anything regarding the create \ use of precompiled
> > header files.
> > 2. I did find that by default, this option in the Project->Property
Settings
> > is set to "NOT use
> > precompile header files". Isn't here that it tells compiler\linker to
> > create\use the precompiled
> > 3.The complain is that it does not find the stdafx.h SOURCE file
> > 4. I do need the atdafx.h file
>
> Your first post said you have #include "stdafx.h" in your code but you
> do not have a stdafx.h file in your project directory. In other words
> you told the compiler to include a file that does not exist. If all
> this is true then that's why it issues the "does not find" error
> message. I hope that makes sense? Also, I don't understand why you

The answer is apparently not. I forgot that, as mark wrote, that
stdafx.h/.cpp are produced by the compiler if I have the #include "stdafx.h"
statement in my source files. So the problem then shifts to not why does
not the compiler find stdafx.h (that is now clear) but rather why does not
it
producing them (or is it possible it producing them in some weird place?!).

I also recalled that the "NOT using precompiled header files" was not by
default but as Mark wrote, by me checking off a respective box during
the new project setup dialogs. But the bottom line is that I am not using
precompiled header files.

I also recalled that in the beta version, I had to include the statement
#undef UNICODE
before the #include "stdafx.h" (thanks to a tip someone gave me here)
but it did not help now even though I added it.

> emphasize SOURCE file - What else would a compiler be looking for? You
> seem to be making some assumptions here that are incorrect, and its hard
> to guess how you are thinking it should work.

I think you are right about this comment - so forget about my emphasis.
>
> The easy solution: Start a new project. Make sure it is the kind of
> project you want for your program. This will give you the proper
> default build settings, and a proper stdafx.h file. Then copy and paste
> your code into the new project.

I have tried that twice (with two different source files that worked
under the VS2005 Beta version) and it did not help.
I noticed by searching the microsoft website that there is a ton of
complains on that very problem but could not find a respond there
that address the root cause of the problem.

Have you actually tried to produce an elementary Win32 Console
Application that has the #include "stdafx.h" statement and
found it to be working with no problem under the VS 2005 Pro
released version?

David

>
> --
> Scott McPhillips [VC++ MVP]
>



.



Relevant Pages

  • Re: VC2005 Pro: IDE (Compiler ?) cant find Stdafx.h
    ... I did not setup up anything regarding the create \ use of precompiled header files. ... I don't understand why you emphasize SOURCE file - What else would a compiler be looking for? ... This will give you the proper default build settings, ...
    (microsoft.public.vc.language)
  • Re: OpenVMS Management Station - HSZTERM
    ... Early HSZs and HSZ firmware did not provide a virtual console LUN; ... My initial attempts to unzip the file failed, ... You will need a C Compiler on ... My thanks to David for his help in getting this set up on my system. ...
    (comp.os.vms)
  • Re: poll interval - RFC compliance question
    ... Ie, that notice is infomational, not a legal requirement. ... and unless they all transfered copyright to David ... each source file has its own copyright notice in ... collective work of all the contributors. ...
    (comp.protocols.time.ntp)
  • Re: Less Templates in VS2008 than VS2005
    ... David, ... C++/CLI compiler is much better than C# compiler, C++/CLI binaries are faster than C# ones, but MS is forcing us to use C# for all. ... How many devices are using .NET Micro? ... Mi blog sobre literatura: http://rfog.blogsome.com ...
    (microsoft.public.dotnet.languages.vc)
  • Re: [Slightly OT] Casting non-void function results to void in modern compilers.
    ... David M. Wilson wrote: ... > Is this a useful modern optimisation? ... > still see it in modern code. ... > compiler can see that the result of printfis not used, ...
    (comp.lang.c)