首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >QDialog不编译

QDialog不编译
EN

Stack Overflow用户
提问于 2015-03-12 23:24:14
回答 1查看 216关注 0票数 1

我正面临着和这个人完全一样的问题:Qmake doesn't generate a header file ..except,已经说过的答案并不能解决我的问题。当我在“qmake”之后“qmake”我的项目时,它不会像书中所说的那样生成头文件。当我按照上述两个命令进行项目时,它会生成一个头文件'ui_gotocell.h‘(它对应于我的项目目录的名称,而不是main.cpp中使用的'ui_gotocelldialog.h’),并以以下错误终止编译:

代码语言:javascript
运行
复制
g++ -c -m32 -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I../Canopy32/appdata/canopy-1.4.1.1975.rh5-x86/mkspecs/linux-g++-32 -I. -I../Canopy32/appdata/canopy-1.4.1.1975.rh5-x86/include/QtCore -I../Canopy32/appdata/canopy-1.4.1.1975.rh5-x86/include/QtGui -I../Canopy32/appdata/canopy-1.4.1.1975.rh5-x86/include -I. -I. -I. -o main.o main.cpp
main.cpp: In function ‘int main(int, char**)’:
main.cpp:10:2: error: ‘GotoCellDialog’ is not a member of ‘Ui’
  Ui::GotoCellDialog ui;
  ^
main.cpp:10:21: error: expected ‘;’ before ‘ui’
  Ui::GotoCellDialog ui;
                    ^
main.cpp:12:2: error: ‘ui’ was not declared in this scope
  ui.setupUi(dialog);
  ^
make: *** [main.o] Error 1
itqan@Itqan:~/gotocell$

我正在使用QT5.4与GNU GCC编译器上的ubuntu 14.04。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-03-13 00:01:40

Ui::GotoCellDialog ui;中将Ui:Dialog ui;替换为main.cpp

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29022212

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档