-
Why ????
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
-
Re: Why ????
In the header file put the word "extern" in front of the declarations and let me know if that works.
-
Re: Why ????
In the .cpp file, before including Extra.h, you need to include stdafx.h.
#include "stdafx.h"
#include "Extra.h"
-
Re: Why ????
nordyj is right, I just assumed you did that.