• «
  • 1
  • 2
  • »
  • Pages: 1/2     Go
主题 : [已解决]应用程序关闭后出现错误“Was terminated due to application error(11)” 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 6476
精华: 0
发帖: 20
金钱: 195 两
威望: 96 点
综合积分: 40 分
注册时间: 2009-06-03
最后登录: 2011-04-14
楼主  发表于: 2009-09-08 17:45

 [已解决]应用程序关闭后出现错误“Was terminated due to application error(11)”

管理提醒: 本帖被 kasim 从 Linux技术交流专区 移动到本区(2009-09-10)
我在mini2440上写了一个小程序,每次关闭程序都会出现这个错误窗口,这是为什么?


上面显示 程序名 Was terminated due to application error(11)”
[ 此帖被kasim在2009-11-04 17:00重新编辑 ]
级别: 新手上路
UID: 7654
精华: 0
发帖: 34
金钱: 230 两
威望: 87 点
综合积分: 68 分
注册时间: 2009-07-23
最后登录: 2011-11-12
1楼  发表于: 2009-09-19 11:54
遇到同样的问题 顶起来
创新改变世界,技术驱动中国
级别: 论坛版主
UID: 7752
精华: 2
发帖: 55
金钱: 570 两
威望: 276 点
综合积分: 150 分
注册时间: 2009-07-27
最后登录: 2010-03-30
2楼  发表于: 2009-09-19 15:14
你的程序是什么样的,让我们观瞻下
级别: 新手上路
UID: 7654
精华: 0
发帖: 34
金钱: 230 两
威望: 87 点
综合积分: 68 分
注册时间: 2009-07-23
最后登录: 2011-11-12
3楼  发表于: 2009-09-19 18:09
复制代码
  1. #include "haha.h"
  2. #include <qpushbutton.h>
  3. #include <qlabel.h>
  4. #include <stdio.h>
  5. #include <termios.h>
  6. #include <unistd.h>
  7. #include <stdlib.h>
  8. #include<sys/ioctl.h>
  9. #include <fcntl.h>
  10. /*
  11. *  Constructs a haha which is a child of 'parent', with the
  12. *  name 'name' and widget flags set to 'f'
  13. */
  14. haha::haha( QWidget* parent,  const char* name, WFlags fl )
  15.     : hahaBase( parent, name, fl )
  16. {
  17.     connect(quit, SIGNAL(clicked()), this, SLOT(goodBye()));
  18.     connect(click, SIGNAL(clicked()), this, SLOT(my()));
  19. }
  20. /*
  21. *  Destroys the object and frees any allocated resources
  22. */
  23. haha::~haha()
  24. {
  25.     // no need to delete child widgets, Qt does it all for us
  26. }
  27. /*
  28. *  A simple slot... not very interesting.
  29. */
  30. void haha::goodBye()
  31. {
  32.     label->setText( "Hello World!" );
  33. }
  34. void haha::my()
  35. {
  36.       /*int fd;
  37. fd = open("/dev/pwm", 0);
  38. if (fd < 0)
  39.    {
  40.      perror("open pwm_buzzer device");
  41.      exit(1);
  42.     }
  43. int ret = ioctl(fd,1, 1000);
  44. if(ret < 0)
  45.   {
  46.     perror("set the frequency of the buzzer");
  47.     exit(1);
  48.   }*/
  49. int fd;
  50.     fd = open("/dev/leds0", 0);
  51.     if (fd < 0) {
  52.         fd = open("/dev/leds", 0);
  53.     }
  54.     if (fd < 0) {
  55.         perror("open device leds");
  56.         exit(1);
  57.     }
  58.    ioctl(fd, 1, 3);
  59.     close(fd);
  60. }


我操作的时候 已经在终端用命令关闭了跑马灯的那个服务
请斑竹费心了
谢谢  
级别: 新手上路
UID: 6476
精华: 0
发帖: 20
金钱: 195 两
威望: 96 点
综合积分: 40 分
注册时间: 2009-06-03
最后登录: 2011-04-14
4楼  发表于: 2009-09-19 23:17
上传一下我的程序吧,源代码没怎么整理,大四了,正在为找工作发愁,也没时间玩linux了,想自己毕业后
基本上什么也不会干,真是惭愧啊








fliker.rar (41 K) 下载次数:40
级别: 新手上路
UID: 7654
精华: 0
发帖: 34
金钱: 230 两
威望: 87 点
综合积分: 68 分
注册时间: 2009-07-23
最后登录: 2011-11-12
5楼  发表于: 2009-09-20 17:15
问题 出在 close(fd);  这句
为什么不能关闭他啊?
哪位大侠给点拨一下了
创新改变世界,技术驱动中国
级别: 论坛版主
UID: 7752
精华: 2
发帖: 55
金钱: 570 两
威望: 276 点
综合积分: 150 分
注册时间: 2009-07-27
最后登录: 2010-03-30
6楼  发表于: 2009-09-21 08:30
引用第5楼waiting320于2009-09-20 17:15发表的  :
问题 出在 close(fd);  这句
为什么不能关闭他啊?
哪位大侠给点拨一下了

可能是你用的关闭文件的close函数,与qwidget类的close函数冲突了
创新改变世界,技术驱动中国
级别: 论坛版主
UID: 7752
精华: 2
发帖: 55
金钱: 570 两
威望: 276 点
综合积分: 150 分
注册时间: 2009-07-27
最后登录: 2010-03-30
7楼  发表于: 2009-09-21 08:35

 回 4楼(sunchaosq) 的帖子

你的问题也可能是在~mywidget()这个函数上,你在其中调用了close(),估计也是和其他类的close函数冲突了
级别: 侠客
UID: 9105
精华: 0
发帖: 95
金钱: 755 两
威望: 307 点
综合积分: 190 分
注册时间: 2009-09-17
最后登录: 2017-09-13
8楼  发表于: 2009-09-29 21:08
肯定和其他类的函数冲突了 就是不知道哪一个?
级别: 侠客
UID: 9105
精华: 0
发帖: 95
金钱: 755 两
威望: 307 点
综合积分: 190 分
注册时间: 2009-09-17
最后登录: 2017-09-13
9楼  发表于: 2009-09-29 21:42
和这里重了  #include <qwidget.h> 一直进去 有个close函数
[ 此帖被hanfeng000在2009-09-30 10:09重新编辑 ]
  • «
  • 1
  • 2
  • »
  • Pages: 1/2     Go