+ Reply to Thread
Results 1 to 2 of 2

Thread: unexpected end of file while looking for precompiled header direct

  1. #1
    Junior Member
    Join Date
    Feb 2012
    Posts
    48

    unexpected end of file while looking for precompiled header direct

    Hi All,

    I am newbe in MFC.

    I am having a project. I just added a new .h and .cpp file in the project. Even if I add following class in it:

    Code:
    //header file:
    	class CMyPoint
    	{
    		public:
    		CMyPoint()
    		~CMyPoint() ;
    	}
    	
    	//source file
    	CMyPoint::CMyPoint()
    	{
    	}
    	
    	CMyPoint::~CMyPoint()
    	{
    	}
    I get this error while I compile:
    "fatal error C1010: unexpected end of file while looking for precompiled header directive"

    Please help.

  2. #2
    It seems that you are using pre-compiled header file support inf your project ("stdafx.h").

    If this is the case, try using one of the below approach:

    a. include "stdafx.h" in your .cpp file.
    b. Do not use precompile header for your .cpp file. Project Properties->C/C++->Precompiled Headers-> select "Not using precompiled headers" option.

    This should resolve your issue.

+ Reply to Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts