Click to See Complete Forum and Search --> : Why ????


Que
September 17th, 1999, 09:17 AM
I wrote 2 files, "Extra.h" and "Extra.cpp"
Why the compiler said:
c:\my documents\receipt\extra.cpp(21) : fatal error C1010: unexpected end of file while looking for precompiled header directive
here is the code of extra.cpp

// implementation of extra functions
/////////////////////////////////////

// change to real date value
void ToReal(int &nDay,int &nMonth,int &nYear)
{
nDay=nDay+1;
nMonth=nMonth+1;
nYear=nYear+1999;
}

// change to combo box value
void ToFake(int &nDay,int &nMonth,int &nYear)
{
nDay=nDay-1;
nMonth=nMonth-1;
nYear=nYear-1999;
}



Here is the header file Extra.h

// this file to contain prototype for extra functions
///////////////////////////////////////////////////

// change value of m_nDay, m_nMonth and m_nYear back and forth

//change to real value of date
void ToReal(int &nDay,int &nMonth,int &nYear);

// change to combo box value
void ToFake(int &nDay,int &nMonth, int &nYear);



Thanks

Wayne Fuller
September 17th, 1999, 09:24 AM
In the header file put the word "extern" in front of the declarations and let me know if that works.

nordyj
September 17th, 1999, 09:31 AM
In the .cpp file, before including Extra.h, you need to include stdafx.h.
#include "stdafx.h"
#include "Extra.h"

Wayne Fuller
September 17th, 1999, 09:42 AM
nordyj is right, I just assumed you did that.