general.h的內容#include "stdafx.h"
#ifndef GENERAL_H
#define GENERAL_H
bool IsFileExist (CString strFileName)
{
CFile fle;
if (fle.Open (strFileName, CFile::modeRead) )
{
fle.Close();
return true;
}
return false;
}
#endif在B.cpp
#include "A.h"
#include "general.h"在A.cpp
#include "general."error LNK2005: "bool __cdecl IsFileExist(class ATL::CStringT<char,class StrTraitMFC_DLL<char,class ATL::ChTraitsCRT<char> > >)" (?IsFileExist@@YA_NV?$CStringT@DV?$StrTraitMFC_DLL@DV?$ChTraitsCRT@D@ATL@@@@@ATL@@@Z) 已經定義於 A.obj