×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

unexpected end of file while looking for precompiled header

unexpected end of file while looking for precompiled header

unexpected end of file while looking for precompiled header

(OP)
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.

RE: unexpected end of file while looking for precompiled header

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.

RE: unexpected end of file while looking for precompiled header

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close