I am just getting started working with VS2008, and I wanted to try to
compile the code (VhdTool.cpp) from:
http://code.msdn.microsoft.com/vhdtool/Release/ProjectReleases.aspx?ReleaseId=2437
I started VS2008, and I did "create a project from an existing file",
but when I try to build it, I am getting the error in the Subject above:
"fatal error C1083: Cannot open include file: 'stdafx.h': No such file
or directory"
I've tried including ATL and MFC, when I create the project, but still
get the same error.
I did some googling and it seems like that "stdafx.h" has something to
do with pre-compiled headers, so I've also tried the different options
under pre-compiled headers in the prject properties, but still get the
same error.
How can I get this .CPP to compile cleanly under VS2008?
Thanks in advance,
Jim
ohaya <oh...@cox.net> spake the secret code
<e82#WsruJH...@TK2MSFTNGP02.phx.gbl> thusly:
>"fatal error C1083: Cannot open include file: 'stdafx.h': No such file
>or directory"
The message is straightforward.
You have a source file that is including stdafx.h and you don't have a
file called stdafx.h.
Either provide the file stdafx.h for it to include, or stop including it.
--
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
<http://www.xmission.com/~legalize/book/download/index.html>
Legalize Adulthood! <http://blogs.xmission.com/legalize/>
I was just able to get the compile (and link) done.
With the "Project from existing code", it didn't get created.
As you suggested, I had to add an "stdafx.h" (removing the include from
the VhdTool.cpp file caused a ton of compile errors), and I eventually
did that, but the way that I did it was pretty convoluted, so I was
wondering:
When using the "Project from existing code" in Visual Studio, what would
the "normal" way be for getting/creating an "stdafx.h" file if the
"stdafx.h" file itself was not included with the original .CPP file?
As I said in my original post, I'm fairly unfamiliar with VS2008, so
that information would be greatly appreciated.
Thanks,
Jim
ohaya <oh...@cox.net> spake the secret code
<#ToMVntu...@TK2MSFTNGP05.phx.gbl> thusly:
>With the "Project from existing code", it didn't get created.
The "project from existing code" doesn't change any of your source files.
If your source file includes a file and you don't have that file,
that's a problem with your source.
It has nothing to do with the project generated by Visual Studio.
Richard wrote:
> [Please do not mail me a copy of your followup]
>
> ohaya <oh...@cox.net> spake the secret code
> <#ToMVntu...@TK2MSFTNGP05.phx.gbl> thusly:
>
>
>>With the "Project from existing code", it didn't get created.
>
>
> The "project from existing code" doesn't change any of your source files.
>
> If your source file includes a file and you don't have that file,
> that's a problem with your source.
>
> It has nothing to do with the project generated by Visual Studio.
Richard,
Ok, thanks. That clarifies things.
Jim
Wasn't stdafx.h one of the include files created by the project wizard
in VS 6.0? The file name sounds very familiar for some reason.
Todd
Todd Carnes <toddc...@gmail.com> spake the secret code
<upN3koxu...@TK2MSFTNGP02.phx.gbl> thusly:
>Wasn't stdafx.h one of the include files created by the project wizard
>in VS 6.0? The file name sounds very familiar for some reason.
I forget VS6, but it is commonly used by the VS.NET wizards as the
name of the generated precompiled header file. However, it is just
the default name used for that option, there is nothing special about
the name. You can call it anything you want by modifying the
project options.
Hi,
I think that my situation was that the link I pointed to had just the
.CPP file, but not the stdafx.h. Since I created a VS project from the
.CPP file, as Richard pointed out, VS doesn't automatically create the
stdafx.h.
Being relatively new to VS (actually, I used it a lot, awhile ago, maybe
6 years ago), I couldn't tell "what kind" of stdafx.h was needed, so
what I did was try to to create console apps in VS with various options,
until I found one that created an stdafx.h. In my case, what worked was
created a console app with ATL.
I then replaced the main .CPP file with the code from the link, and that
almost worked, except I then got a linker error for an unresolved, which
I fixed by including RpcRT4.lib.
After that, the project compiled and linked ok.
Jim