Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

unexpected end of file while looking for precompiled header

Status
Not open for further replies.

momukhtar

Programmer
Mar 10, 2008
8
I am making a dll in Visual Studio 2005 in Visual C++. The folder structure is like this

Z:\abc\1stProj\jkl.h

Z:\abc\1stProj\mno.h

Z:\abc\1stProj\mno.cpp

This jkl.h contains the directive #include "mno.h".


There is another Project in the folder. This is windows application .exe

Z:\abc\2ndProject\pqr.h

Z:\abc\2ndProject\pqr.cpp

This pqr.h has the directive

#include "../1stProj/jkl.h"

This mno.h and mno.cpp from 1st Project is added in the 2ndProject (By right clicking and adding an existing item )and working fine.
Then We are able to call the methods of the class implemented in mno.cpp. builds and debugs successfully


There is third Project in the folder. This is dll

Z:\abc\3rdProject\xyz.h

Z:\abc\rdProject\xyz.cpp


This xyz.h has the directive

#include "../1stProj/jkl.h"

and I am calling the methods of the class implemented in mno.cpp .

This mno.h and mno.cpp from 1st Project is added in the 3rdProject (By right clicking and adding an existing item )

Error 4 fatal error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? Z:\abc\1stProj\mno.cpp

Please help.
 
Your Project Settings are set to use precompiled headers. Either turn off that setting, or create a "stdafx.h" header and add:
Code:
#include "stdafx.h"
to each of your .cpp files before any other #include statements.
 
When creating your new project in Visual Studio, check the "Empty Project" checkbox in the Application Settings page of the wizard. This will stop Visual Studio from adding the code for precompiled headers that isn't necessary for your project.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top