请教在MFC中,要使用自己的头文件,应该怎么设置
请问在MFC中,要使用自己的头文件,应该如何设置?
假设我用头文件声明了2个全局函数
例如头文件名为test.h
void a();
void b();
然后在CPP中
#include "test.h "
#include "stdafx.h "
void a()
{}
void b()
{}
最后在要使用该头文件函数的头文件中包含test.h
但是在使用时,使用第一个函数没出现错误
使用第二个错误时,就出现了
error LNK2001: unresolved external symbol "bool __cdecl CheckFormat(class CString const &,class CString &) " (?CheckFormat@@YA_NABVCString@@AAV1@@Z)
这样的错误.
请问是什么原因?
在MFC中,使用自己的头文件有什么需要注意的?
------解决方案--------------------
#include "test.h "
#include "stdafx.h "
调换顺序---》
#include "stdafx.h "
#include "test.h "
假设我用头文件声明了2个全局函数
例如头文件名为test.h
void a();
void b();
然后在CPP中
#include "test.h "
#include "stdafx.h "
void a()
{}
void b()
{}
最后在要使用该头文件函数的头文件中包含test.h
但是在使用时,使用第一个函数没出现错误
使用第二个错误时,就出现了
error LNK2001: unresolved external symbol "bool __cdecl CheckFormat(class CString const &,class CString &) " (?CheckFormat@@YA_NABVCString@@AAV1@@Z)
这样的错误.
请问是什么原因?
在MFC中,使用自己的头文件有什么需要注意的?
------解决方案--------------------
#include "test.h "
#include "stdafx.h "
调换顺序---》
#include "stdafx.h "
#include "test.h "