首页| 论坛| 消息

标题:编译qte2.3.7程序时出错
作者:oyhuan
日期:2009-04-21 19:24
内容:

交叉编译完qte2.3.7,写了个test程序,里面调用了ACE库
#include
#include
#include
int main(int argc, char **argv)
{
        QApplication a(argc, argv);
        QPushButton hello("hello,world", 0);
        hello.resize(100, 30);
        char title[32];
        ACE_OS::sprintf(title,"你好");
        hello.setText(QString::fromUtf8(title));
        a.setMainWidget(&hello);
        hello.show();
        return a.exec();
}

运行make时出现以下错误
# make
arm-linux-g++ -c -pipe -DQWS -fno-exceptions -fno-rtti -Wall -W -O2 -DNO_DEBUG -I/opt/qt/qte/include -I/opt/ace/ACE_wrappers -o test.o test.cpp
In file included from /opt/qt/qte/include/qwindowdefs.h:44,
from /opt/qt/qte/include/qwidget.h:42,
from /opt/qt/qte/include/qapplication.h:42,
from test.cpp:1:
/opt/qt/qte/include/qstring.h: In member function `uchar& QChar::cell()':
/opt/qt/qte/include/qstring.h:166: error: cannot bind packed field `((QChar*)this)->QChar::cl' to `uchar&'
/opt/qt/qte/include/qstring.h: In member function `uchar& QChar::row()':
/opt/qt/qte/include/qstring.h:167: error: cannot bind packed field `((QChar*)this)->QChar::rw' to `uchar&'
make: *** Error 1
#

Makefile文件:
[root@localh ..


#1 [yangchun1984 04-22 08:12]
你的test程序用到了信号与槽嘛?如果用到了,似乎还要moc一下!
#2 [oyhuan 04-22 08:46]
引用第1楼yangchun1984于2009-04-22 08:12发表的:
你的test程序用到了信号与槽嘛?如果用到了,似乎还要moc一下!
谢谢你,里面调用了ACE库,是没加ACE库的原因。
刚才的错误也经没有了,现在又出现新的错误。我修改了一下内容,能帮我看看吗?
#3 [oyhuan 04-22 10:46]
我可能知道原因了,
ACE是用3。4。1交叉编译器,QTE用2.95.3交叉编译器。是不是这个原因有冲突?
现在又有一个问题ACE不能用2.95.3编译,QTE不能用3.4.1交叉编译。
大家,帮下忙吧。。
我想用3.4.1交叉编译QTE,要改哪些源代码吗?
#4 [oyhuan 04-23 16:12]
解决了,是因为编译环境不同,不兼容
#5 [wwwindd 04-28 21:19]
你查看下qt-embedded下/mkspecs/linux-g++/qmake.conf 里面的交叉编译链是不是添加进去
还有一个qmake-cache 忘了在哪 里面也是要修改下交叉编译链的
我今天也碰到这样问题,糊里糊涂就搞的解决了,暂时只能知道大概是qmake这里的问题.

回复 发表
主题 版块