小弟,对qt 手册里面提供的例子进行编译,(qtopia 2.2.0),
void CannonField::paintEvent(QPaintEvent *)
// void paintEvent(QPaintEvent *);
{
.........QPainter p(this);
。。。
p.rotate(-ang);//void rotate( double a );
。。。。。。
}
/////
开始编译 提示class Qpainter 未定义rotate 函数,
找到 qt2/include/qpainter.h
里面 有一段:
#ifndef QT_NO_TRANSFORMATIONS
。。。。
void scale( double sx, double sy );
void shear( double sh, double sv );
void rotate( double a );
#endif
然后试着 到qt2/src/tools/qconfig-qpe.h 把 #define QT_NO_TRANSFORMATIONS 注释掉
再在 qt2 文件夹、 qtopia文件夹下 make
重新编译。 为的是在 qtopia /lib 下重新生成 libqte.so
可再次编译时出现 如下错提示
.obj/release-shared/cannon.o: In function `CannonField::paintEvent(QPaintEvent*)':
cannon.cpp:(.text+0xd4): undefined reference to `QPainter::rotate(double)'
collect2: ld returned 1 exit status
make: *** [/opt/FriendlyARM/mini2440/arm-qtopia/qtopia-2.2.0-FriendlyARM/qtopia/bin/lcdrange] Error 1
能否提示一下,到底哪出错了。
小弟 先谢了