我定义了一个class
class myThread : public Qthread{
public:
virtual void run();
};
void myThread::run(){
int cnt=1;
while(1){
pcap_dispatch(p_handler, //libpcap 句柄
cnt, //要抓取的数据包的个数
ethernet_protocol_packet_callback, //回调函数
NULL); //传给回调函数的参数
}
}
编译的时候:
.ui/mainform.h:52: 'myThread' is used as a type, but is not defined as a type.
In file included from mythread.h:2, (我已经在mainform.ui.h头文件中加了#inculde "mythread.h")
............
mythread.h: At global scope:
mythread.h:5: parse error before `{' token
mythread.h:9: invalid use of undefined type `class myThread'
mythread.h:5: forward declaration of `class myThread'
是不是我定义class的格式有问题呢?
[ 此贴被ediml在2006-05-31 16:07重新编辑 ]