用向导生成的Dll中加入自己的类出错!
煜知搬砖者 2003-04-11 08:42:38 但是我按照VC的ATL向导生成了一个Dll
然后我建了一个类
文件名:test.h
class test{
public:
test(){
a = 1;
}
int getIntValue();
void setIntValue(int newInt);
~test(){};
private:
int a;
};
它的实现文件:test.cpp
#include "test.h"
#include "stdafx.h" ----------------------------------------请注意
int test::getIntValue(){
return a ;
}
void test::setIntValue(int newInt){
a = newInt;
}
把这两个文件分别加入相应的文件夹中,但是
在test.cpp中,我把#include "stdafx.h"注释掉后:
VC报错内容为:
fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.
如果不注释掉,VC报错的内容为:
error C2653: 'test' : is not a class or namespace name
error C2065: 'a' : undeclared identifier
error C2653: 'test' : is not a class or namespace name
请大虾们指点分析一下,