小弟头次发帖求助,正在学习qthread类,开发环境如下:
linux虚拟机,红帽版本9.0 ,linux 2.4内核
安装的工具为tmake-1.11,qt-2.3.7,qt-2.3.2,没有安装交叉编译。
我尝试编一个最简单的qthread程序。使用designer生成threadform.ui文件,uic生成threadform.h和threadform.cpp文件,
手动建立thread.h,thread.cpp两个文件引入Qthread类。最后加上threadform.pro,main.cpp开始编译。
编译时总是报错误如下:
In file included from threadform.h:11,
from main.cpp:1:
threa.h:5:parse error before '{' token
thread.h:10:parse error before '}'token
make:***[main.o]Error 1
其中:
threadform.h:11 对应的代码是include "thread"
main.cpp:1 对应的代码是“include"threadform.h"
附:<thread.h>
#ifndef THREAD_H
#define THREAD_H
#include <qthread.h>
class Thread:public QThread
{
public:
Thread();
void run();
volatile bool stopped;
};
#endif
错在哪里,请指点谢谢!