QT调试问题

apple_prince 2010-09-08 02:57:09
本人初学QT,运行书上面的代码结果报如下错误,请高手指点~ 呵呵



Running build steps for project Dialog...
Starting: C:/Qt/2010.02/mingw/bin/mingw32-make.exe clean -w
mingw32-make: Entering directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
C:/Qt/2010.02/mingw/bin/mingw32-make -f Makefile.Debug clean
mingw32-make[1]: Entering directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
del debug\moc_mainwindow.cpp debug\moc_finddialog.cpp
del ui_mainwindow.h
del debug\main.o debug\mainwindow.o debug\finddialog.o debug\moc_mainwindow.o debug\moc_finddialog.o
mingw32-make[1]: Leaving directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
C:/Qt/2010.02/mingw/bin/mingw32-make -f Makefile.Release clean
找不到 C:\Documents and Settings\Administrator\My Documents\ddd\Signal\LayOut\Dialog\debug\moc_mainwindow.cpp
找不到 C:\Documents and Settings\Administrator\My Documents\ddd\Signal\LayOut\Dialog\debug\main.o
mingw32-make[1]: Entering directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
del release\moc_mainwindow.cpp release\moc_finddialog.cpp
del ui_mainwindow.h
del release\main.o release\mainwindow.o release\finddialog.o release\moc_mainwindow.o release\moc_finddialog.o
mingw32-make[1]: Leaving directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
mingw32-make: Leaving directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
找不到 C:\Documents and Settings\Administrator\My Documents\ddd\Signal\LayOut\Dialog\release\moc_mainwindow.cpp
找不到 C:\Documents and Settings\Administrator\My Documents\ddd\Signal\LayOut\Dialog\ui_mainwindow.h
找不到 C:\Documents and Settings\Administrator\My Documents\ddd\Signal\LayOut\Dialog\release\main.o
Exited with code 0.
Starting: c:/qt/2010.02/qt/bin/qmake.exe C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog/Dialog.pro -spec win32-g++ -r
Exited with code 0.
Starting: C:/Qt/2010.02/mingw/bin/mingw32-make.exe -w
mingw32-make: Entering directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
C:/Qt/2010.02/mingw/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
c:\Qt\2010.02\qt\bin\uic.exe mainwindow.ui -o ui_mainwindow.h
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"c:\Qt\2010.02\qt\include\QtCore" -I"c:\Qt\2010.02\qt\include\QtGui" -I"c:\Qt\2010.02\qt\include" -I"c:\Qt\2010.02\qt\include\ActiveQt" -I"debug" -I"." -I"c:\Qt\2010.02\qt\mkspecs\win32-g++" -o debug\main.o main.cpp
c:\Qt\2010.02\qt\include/QtGui/../../src/gui/kernel/qwidget.h: In function 'int qMain(int, char**)':
c:\Qt\2010.02\qt\include/QtGui/../../src/gui/kernel/qwidget.h:485: error: 'void QWidget::show()' is inaccessible
main.cpp:9: error: within this context
main.cpp:9: error: 'QWidget' is not an accessible base of 'FindDialog'
mingw32-make[1]: Leaving directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
mingw32-make: Leaving directory `C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog'
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make: *** [debug] Error 2
Exited with code 2.
Error while building project Dialog
When executing build step 'Make'
...全文
314 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
pp0354030 2010-11-01
  • 打赏
  • 举报
回复
路径名中不能包含空格和中文!MS windows版本的QT SDK不需要设置环境变量吧,反正我安装了N多次,重来没设置过!
pp0354030 2010-11-01
  • 打赏
  • 举报
回复
路径名中不能包含空格和中文!MS windows版本的QT SDK不需要设置环境变量吧,反正我安装了N多次,重来没设置过!
showtimeb 2010-10-22
  • 打赏
  • 举报
回复
PATH=/usr/lib/qt4/bin:$PATH
这是Linux下设置环境变量的方法,不知道对你有用不 另外的就是上面的大虾们说了路径名 文件名 不能有空格
法尔我给他 2010-09-16
  • 打赏
  • 举报
回复
将你的项目文件,放到一个根目录下就行了
qt不支持两个空格的路径
月中蓝 2010-09-14
  • 打赏
  • 举报
回复
路径名有空格
DIE654456 2010-09-09
  • 打赏
  • 举报
回复
directory
"C:/Documents and Settings/Administrator/My Documents/ddd/Signal/LayOut/Dialog"
Qt编译不喜欢带中文和空格的文件夹。
dext 2010-09-08
  • 打赏
  • 举报
回复
文件夹 不要有空格。
yanchong 2010-09-08
  • 打赏
  • 举报
回复
对,设置环境变量
zhh_kv 2010-09-08
  • 打赏
  • 举报
回复
设置path环境变量
wyfwx 2010-09-08
  • 打赏
  • 举报
回复
project上看下路径对不?选择 Debug 或者 release
gaowenboms 2010-09-08
  • 打赏
  • 举报
回复
你把工程cleanALL,再rebuild all 一下看看,

另外可能是你QT环境没设好,

16,216

社区成员

发帖
与我相关
我的任务
社区描述
Qt 是一个跨平台应用程序框架。通过使用 Qt,您可以一次性开发应用程序和用户界面,然后将其部署到多个桌面和嵌入式操作系统,而无需重复编写源代码。
社区管理员
  • Qt
  • 亭台六七座
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧