首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

在用dev-CPP的时候每次遇到多个文件链接就编译出错解决方案

2012-04-13 
在用dev-CPP的时候每次遇到多个文件链接就编译出错问题描述:新建工程,在main.cpp中包含了头文件 ui_gotoce

在用dev-CPP的时候每次遇到多个文件链接就编译出错
问题描述:新建工程,在main.cpp中包含了头文件 ui_gotocelldialog.h。main.cpp和ui_gotocelldialog.h中的代码均无误。但是编译的时候会出现如下错误:

引用 编译器: Default compiler
Building Makefile: "C:\Documents and Settings\Administrator\桌面\gotocell\Makefile.win"
执行 make...
make.exe -f "C:\Documents and Settings\Administrator\桌面\gotocell\Makefile.win" all
g++.exe -c main.cpp -o main.o -I"d:/Dev-Cpp/include" -I"D:/Qt/4.4.0/include" -I"D:/Qt/4.4.0/include/Qt" -I"D:/Qt/4.4.0/include/Qt3Support" -I"D:/Qt/4.4.0/include/QtAssistant" -I"D:/Qt/4.4.0/include/QtCore" -I"D:/Qt/4.4.0/include/QtDesigner" -I"D:/Qt/4.4.0/include/QtGui" -I"D:/Qt/4.4.0/include/QtDBus" -I"D:/Qt/4.4.0/include/QtNetwork" -I"D:/Qt/4.4.0/include/QtSvg" -I"D:/Qt/4.4.0/include/QtOpenGL" -I"D:/Qt/4.4.0/include/QtSql" -I"D:/Qt/4.4.0/include/QtTest" -I"D:/Qt/4.4.0/include/QtUiTools" -I"D:/Qt/4.4.0/include/QtXml"

In file included from main.cpp:4:
ui_gotocelldialog.h:81: error: missing terminating " character
ui_gotocelldialog.h:82: error: missing terminating " character

ui_gotocelldialog.h: In member function `void Ui_GoToCellDialog::retranslateUi(QWidget*)':
ui_gotocelldialog.h:82: error: `To' undeclared (first use this function)
ui_gotocelldialog.h:82: error: (Each undeclared identifier is reported only once for each function it appears in.)
ui_gotocelldialog.h:86: error: `QApplic' undeclared (first use this function)

In file included from main.cpp:4:
ui_gotocelldialog.h:100:30: warning: no newline at end of file
main.cpp: In function `int main(int, char**)':
main.cpp:12: error: statement cannot resolve address of overloaded function

make.exe: *** [main.o] Error 1

执行结束

补充:凡是遇到多个文件相互链接的时候一般编译都会出错,感谢您的解答和帮助

[解决办法]
报错的部分提示的比较明显啊:

`To' undeclared (first use this function)
`QApplic' undeclared (first use this function)

这两个是关键错误,解决掉,再看看别的错误是否消失
最后一个warning是需要你在源文件最后加个回车,即可。
[解决办法]
C:\Documents and Settings\Administrator\桌面

gcc 编译器不要有空格目录 和 中文目录
[解决办法]
TO

QApplic
你肯定忘了在前面宣告
undeclared<<就是未定義的意思
變量跟function 未定義,它都會出這些字,很好找的說
認住undeclared

热点排行