arm与linux些许问题,arm-linux中遇到的问题

#include int main( int argc, char **argv )

{

QApplication a( argc, argv );

QPushButton hellobtn( "Hello world!", 0 );

hellobtn.resize(100, 20 );

a.setMainWidget( &hellobtn );

hellobtn.show();

return a.exec();

}

这是代码.

这是我执行hello程序时候出现的问题

[root@fkw root]# cd /root/qt

[root@fkw qt]# qmake

[root@fkw qt]# make

g++ -c -pipe -Wall -W -O2 -g -pipe -march=i386 -mcpu=i686 -fno-use-cxa-atexit -fno-exceptions -DQT_NO_DEBUG -I/usr/lib/qt-3.1/mkspecs/default -I. -I/usr/lib/qt-3.1/include -I.ui/ -I.moc/ -o .obj/hello.o hello.cpp

hello.cpp:1:24: QApplication: 没有那个文件或目录

hello.cpp:2:23: QPushButton: 没有那个文件或目录

hello.cpp: In function `int main(int, char**)':

hello.cpp:5: error: `QApplication' undeclared (first use this function)

hello.cpp:5: error: (Each undeclared identifier is reported only once for each

function it appears in.)

hello.cpp:5: error: syntax error before `(' token

hello.cpp:6: error: `QPushButton' undeclared (first use this function)

hello.cpp:7: error: `hello' undeclared (first use this function)

hello.cpp:9: error: `app' undeclared (first use this function)

hello.cpp:4: warning: unused parameter `int argc'

hello.cpp:4: warning: unused parameter `char**argv'

解决方法:如果qt安装正确的话,这个问题是由于没有修改环境变量引起的,只要将/usr/local/Trolltech/Qt-4.2.2/bin添加到PATH变量,操作如下:

用vi 打开.bash_profile

在文件的最后一行加上:

PATH=/usr/local/Trolltech/Qt-4.2.2/bin:$PATH

export PATH

保存退出。再次编译就不会出现这个问题啦。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值