看看这两行-DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o main.o main.cpp
Qt程序编辑
- comfanter
- 帖子: 190
- 注册时间: 2009-05-02 14:51
Re: Qt程序编辑
-
- 帖子: 433
- 注册时间: 2009-07-06 14:26
- comfanter
- 帖子: 190
- 注册时间: 2009-05-02 14:51
Re: Qt程序编辑
那是编译产生的信息,你用新立得搜索qt3,然后把包含qt3的都删除
-
- 帖子: 433
- 注册时间: 2009-07-06 14:26
-
- 帖子: 433
- 注册时间: 2009-07-06 14:26
Re: Qt程序编辑
请问如何用GDB调试QT的程序?
就是前面发的那个程序,生成了可执行文件后
不能像其他C程序一样但不调试什么的,请问下这是怎么回事?
就是前面发的那个程序,生成了可执行文件后
代码: 全选
wangjun@wj-dt:~/qt/chap01/hello$ ls
hello hello.cpp hello.pro Makefile
代码: 全选
wangjun@wj-dt:~/qt/chap01/hello$ gdb hello
GNU gdb (GDB) 7.0-ubuntu
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/wangjun/qt/chap01/hello/hello...done.
(gdb) b main
Breakpoint 1 at 0x80488b3
(gdb) run
Starting program: /home/wangjun/qt/chap01/hello/hello
[Thread debugging using libthread_db enabled]
Breakpoint 1, 0x080488b3 in main ()
(gdb) s
Single stepping until exit from function main,
which has no line number information.
生命只不过是上帝借你一用的资本!
- wangdu2002
- 帖子: 13284
- 注册时间: 2008-12-13 19:39
- 来自: 物华天宝人杰地灵
Re: Qt程序编辑
还是买本Qt编程的书,系统学习和编程实践下吧。。。Qt的问题可以到Qt中文论坛去找贴子。。。 

行到水穷处,坐看云起时。
海内生明月,天涯共此夕。
--------------------吾本独!
海内生明月,天涯共此夕。
--------------------吾本独!
-
- 帖子: 433
- 注册时间: 2009-07-06 14:26
-
- 帖子: 33
- 注册时间: 2007-02-28 0:06
Re: Qt程序编辑
试试下面的代码来编译
通常自己下载的SDK安装于/opt下
代码: 全选
/opt/qtsdk-2009.04/qt/bin/qmake -project
/opt/qtsdk-2009.04/qt/bin/qmake
make
- md5xwl
- 帖子: 133
- 注册时间: 2008-10-29 22:16
- 联系:
-
- 帖子: 6548
- 注册时间: 2008-10-31 22:12
- 系统: 践兔
- 联系:
Re: Qt程序编辑
wangjun403 写了:代码: 全选
wangjun@wj-dt:~/workspace/hellomake$ ls main.cpp wangjun@wj-dt:~/workspace/hellomake$ cat main.cpp #include <QApplication> #include <QLabel> int main(int argc, char *argv[]) { QApplication app(argc,argv); //创建对象 QLabel *label=new QLabel("hello zhangrong!"); //QLabel对象,小控件 label->show(); return app.exec(); //让程序进入æM -& wangjun@wj-dt:~/workspace/hellomake$
这应该是没有找到QT的函数库,我该把文件放在那里?代码: 全选
wangjun@wj-dt:~/workspace/hellomake$ qmake -project wangjun@wj-dt:~/workspace/hellomake$ ls hellomake.pro main.cpp wangjun@wj-dt:~/workspace/hellomake$ qmake wangjun@wj-dt:~/workspace/hellomake$ ls hellomake.pro main.cpp Makefile wangjun@wj-dt:~/workspace/hellomake$ make g++ -c -pipe -g -Wall -W -O2 -D_REENTRANT -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -DQT_TABLET_SUPPORT -I/usr/share/qt3/mkspecs/default -I. -I. -I/usr/include/qt3 -o main.o main.cpp main.cpp:1:24: error: QApplication: 没有该文件或目录 main.cpp:2:18: error: QLabel: 没有该文件或目录 main.cpp: In function ‘int main(int, char**)’: main.cpp:6: error: ‘QApplication’ was not declared in this scope main.cpp:6: error: expected ‘;’ before ‘app’ main.cpp:7: error: ‘QLabel’ was not declared in this scope main.cpp:7: error: ‘label’ was not declared in this scope main.cpp:7: error: expected type-specifier before ‘QLabel’ main.cpp:7: error: expected ‘;’ before ‘QLabel’ main.cpp:9: error: ‘app’ was not declared in this scope main.cpp:9: error: expected ‘}’ at end of input main.cpp: At global scope: main.cpp:4: warning: unused parameter ‘argc’ main.cpp:4: warning: unused parameter ‘argv’ make: *** [main.o] 错误 1 wangjun@wj-dt:~/workspace/hellomake$
或者是其他地方错了
代码: 全选
s qmake &-qt4 g
代码: 全选
] ls -ld //