complier looking for stdafx.h

My code is way to large too post. There are 20 files in my project. I have  #include <stdafx.h>
On the  first line of the main cpp file but compiler seems to be looking for it in the other
Files too I dont understand why. I have every file in solution. One should be enough.
1>------ Build started: Project: MastrerDLinkListTest, Configuration: Debug Win32 ------
1>Compiling...
1>DLinkList.cpp
1>c:\testinclude\dlinklist.cpp(286) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
1>DLNode.CPP
1>c:\testinclude\dlnode.cpp(66) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
1>DSLinkList.cpp
1>c:\testinclude\dslinklist.cpp(180) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
1>TestDSLink.cpp
1>c:\testinclude\testdslink.cpp(421) : fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source?
1>Generating Code...
1>Build log was saved at "file://c:\Users\store30\Documents\Visual Studio 2005\Projects\MastrerDLinkListTest\MastrerDLinkListTest\Debug\BuildLog.htm"
1>MastrerDLinkListTest - 4 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


bdavid35Asked:
Who is Participating?
 
jkrConnect With a Mentor Commented:
>>Note that <stdafx.h> is not the same as "stdafx.h"

That does not make any difference here - just in one file is simply not enough.

More info and docs at http://msdn2.microsoft.com/en-us/library/3dxawkbx(vs.80).aspx ("Using Precompiled Headers in a Project")
0
 
Infinity08Connect With a Mentor Commented:
Note that <stdafx.h> is not the same as "stdafx.h"

Use this :

        #include "stdafx.h"
0
 
jkrCommented:
You need to either add the include directive to the beginning of each file or set the "Precompiled Header" feature in your project settings to use a different header file for these. Since adding that is way easier, I'd say: Just do it.
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
Infinity08Commented:
>> just in one file is simply not enough.

Ah, missed that bit in the question ;)
0
 
bdavid35Author Commented:



 
 I set the "precompiled header" in my project and nothing changed . so  I made sure all my files had
#include "stdafx.h" but now the compiler says i that It cant find "stdafx.h" while it seems like it accept
earilier occurances of it. what shall i do???????
Thanks
bdavid35
0
 
jkrCommented:
Well, create an empty "stdafx.h" file (yes, I *do* know this sounds stupid) in yout solution/project's directory, that should help.
0
 
bdavid35Author Commented:

i started note  pad and saved an empty file named  " stdafx.h" in the solution/project's directory but I got the same results.
bdavid35
0
 
jkrCommented:
Did you place it there where the .vcproj file lives? Or even better, the directory where your .cpp files reside...
0
 
bdavid35Author Commented:
thank you very much for your help
0
All Courses

From novice to tech pro — start learning today.