• 7290阅读
  • 5回复

make时报错 [复制链接]

上一主题 下一主题
离线xupeng
 
只看楼主 正序阅读 楼主  发表于: 2009-03-03
C:\Qt\hello>make
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Qt/hello'
gcc -c -g -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_CORE
_LIB -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\4.4.3\include\QtCore" -I"..\4.4.
3\include\QtCore" -I"..\4.4.3\include\QtGui" -I"..\4.4.3\include\QtGui" -I"..\4.
4.3\include" -I"." -I"c:\Qt\4.4.3\include\ActiveQt" -I"debug" -I"." -I"..\4.4.3\
mkspecs\win32-g++" -o debug\main.o main.c
In file included from ../4.4.3/include/QtCore/qnamespace.h:1,
                 from ../4.4.3/include/QtCore/../../src/corelib/kernel/qobjectde
fs.h:41,
                 from ../4.4.3/include/QtCore/qobjectdefs.h:1,
                 from ../4.4.3/include/QtCore/../../src/corelib/kernel/qobject.h
:43,
                 from ../4.4.3/include/QtCore/qobject.h:1,
                 from ../4.4.3/include/QtCore/../../src/corelib/kernel/qcoreappl
ication.h:41,
                 from ../4.4.3/include/QtCore/qcoreapplication.h:1,
                 from ../4.4.3/include/QtGui/../../src/gui/kernel/qapplication.h
:41,
                 from ../4.4.3/include/QtGui/qapplication.h:1,
                 from ../4.4.3/include/QtGui/QApplication:1,
                 from main.c:1:
../4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:50: error: syntax
error before "namespace"
../4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:54: error: syntax
error before '{' token
../4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:121: warning: retu
rn type defaults to `int'
../4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h: In function `Q_DE
CLARE_FLAGS':
../4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: `Qt' u
ndeclared (first use in this function)
../4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: (Each
undeclared identifier is reported only once
../4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: error: for ea
ch function it appears in.)
../4.4.3/include/QtCore/../../src/corelib/global/qnamespace.h:122: confused by e
arlier errors, bailing out
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make[1]: Leaving directory `C:/Qt/hello'
mingw32-make: *** [debug] Error 2

C:\Qt\hello>


请问这是什么错误呀?怎么解决?
离线xupeng
只看该作者 5楼 发表于: 2009-03-05
呀。。就是。用C用习惯了。刚开始用C++。不好意思哈。。现在好了。。多谢啦。。
离线浪漫天使
只看该作者 4楼 发表于: 2009-03-04
main.c.......................
main.cpp吧 。。。。
离线liuyong_401
只看该作者 3楼 发表于: 2009-03-04
为啥我在机器上就能运行?? .pro文件要写对  你qmake的时候一定要把路径弄清楚  否则会出错的
离线xupeng
只看该作者 2楼 发表于: 2009-03-04
哦。。谢谢。。
源码很简单。就是书上的hello world那个例子

#include <QApplication>
#include <QLabel>
int main(int argc,char *argv[])
{
QApplication app(argc,argv);
QLabel *label = new QLabel("hello qt");
label -> show();
return app.exec();
}
离线wd007

只看该作者 1楼 发表于: 2009-03-03
光看这个,不好回答。

从错误提示上,对比你的源码应该可以找到问题所在。

断点调试不行吗
欢迎访问我的博客,一起学习提高
http://blog.csdn.net/qter_wd007
快速回复
限100 字节
 
上一个 下一个