It was maybe caused by setting on include path.
my code is --
#include <Qt/QApplication.h>
#include <Qt/QLabel.h>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QLabel *label = new QLabel("Hello Qt!");
label->show();
return app.exec();
}
And after running "mingw32-make", following error msg came in:
mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/wp_Cpp/hello'
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'../../Qt/4.4.0/include/QtCore' -I'../../Qt/4.
4.0/include/QtCore' -I'../../Qt/4.4.0/include/QtGui' -I'../../Qt/4.4.0/include/QtGui' -I'../../Qt/4.4.0/include' -I'.' -I'c:/Qt/4.4.0/include/ActiveQt' -I'debug' -I'.' -I'../../Qt/4.4.0/mkspecs/win32-
g++' -o debug/hello.o hello.cpp
In file included from ../../Qt/4.4.0/include/QtCore/qglobal.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qnamespace.h:47,
from ../../Qt/4.4.0/include/QtCore/qnamespace.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qobjectdefs.h:47,
from ../../Qt/4.4.0/include/QtCore/qobjectdefs.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qobject.h:49,
from ../../Qt/4.4.0/include/QtCore/qobject.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:47,
from ../../Qt/4.4.0/include/QtCore/qcoreapplication.h:1,
from ../../Qt/4.4.0/include/Qt/../../src/gui/kernel/qapplication.h:47,
from ../../Qt/4.4.0/include/Qt/QApplication.h:1,
from hello.cpp:1:
../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qglobal.h:47:20: stddef.h: No such file or directory
In file included from ../../Qt/4.4.0/include/QtCore/qglobal.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qnamespace.h:47,
from ../../Qt/4.4.0/include/QtCore/qnamespace.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qobjectdefs.h:47,
from ../../Qt/4.4.0/include/QtCore/qobjectdefs.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qobject.h:49,
from ../../Qt/4.4.0/include/QtCore/qobject.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:47,
from ../../Qt/4.4.0/include/QtCore/qcoreapplication.h:1,
from ../../Qt/4.4.0/include/Qt/../../src/gui/kernel/qapplication.h:47,
from ../../Qt/4.4.0/include/Qt/QApplication.h:1,
from hello.cpp:1:
../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qglobal.h:1850: error: variable `qMalloc' definition is marked dllimport.
../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qglobal.h:1850: error: `size_t' was not declared in this scope
../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qglobal.h:1852: error: `size_t' has not been declared
../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qglobal.h:1852: error: ISO C++ forbids declaration of `size' with no type
../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qglobal.h:1853: error: `size_t' has not been declared
../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qglobal.h:1853: error: ISO C++ forbids declaration of `n' with no type
../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qglobal.h:1854: error: `size_t' has not been declared
../../Qt/4.4.0/include/QtCore/../../src/corelib/global/qglobal.h:1854: error: ISO C++ forbids declaration of `n' with no type
In file included from ../../Qt/4.4.0/include/QtCore/qbytearray.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qstring.h:48,
from ../../Qt/4.4.0/include/QtCore/qstring.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qobject.h:50,
from ../../Qt/4.4.0/include/QtCore/qobject.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:47,
from ../../Qt/4.4.0/include/QtCore/qcoreapplication.h:1,
from ../../Qt/4.4.0/include/Qt/../../src/gui/kernel/qapplication.h:47,
from ../../Qt/4.4.0/include/Qt/QApplication.h:1,
from hello.cpp:1:
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:50:20: string.h: No such file or directory
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:51:20: stdarg.h: No such file or directory
In file included from ../../Qt/4.4.0/include/QtCore/qbytearray.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qstring.h:48,
from ../../Qt/4.4.0/include/QtCore/qstring.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qobject.h:50,
from ../../Qt/4.4.0/include/QtCore/qobject.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:47,
from ../../Qt/4.4.0/include/QtCore/qcoreapplication.h:1,
from ../../Qt/4.4.0/include/Qt/../../src/gui/kernel/qapplication.h:47,
from ../../Qt/4.4.0/include/Qt/QApplication.h:1,
from hello.cpp:1:
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h: In function `uint qstrlen(const char*)':
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:70: error: `strlen' undeclared (first use this function)
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:70: error: (Each undeclared identifier is reported only once for each function it appears in.)
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h: In function `int qstrncmp(const char*, const char*, uint)':
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:93: error: `strncmp' undeclared (first use this function)
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h: At global scope:
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:100: error: `size_t' has not been declared
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:100: error: `va_list' has not been declared
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:100: error: ISO C++ forbids declaration of `n' with no type
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:100: error: ISO C++ forbids declaration of `ap' with no type
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:101: error: `size_t' has not been declared
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:101: error: ISO C++ forbids declaration of `n' with no type
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h: In function `bool operator==(const QByteArray&, const QByteArray&)':
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qbytearray.h:495: error: `memcmp' undeclared (first use this function)
In file included from ../../Qt/4.4.0/include/QtCore/qstring.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qobject.h:50,
from ../../Qt/4.4.0/include/QtCore/qobject.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qcoreapplication.h:47,
from ../../Qt/4.4.0/include/QtCore/qcoreapplication.h:1,
from ../../Qt/4.4.0/include/Qt/../../src/gui/kernel/qapplication.h:47,
from ../../Qt/4.4.0/include/Qt/QApplication.h:1,
from hello.cpp:1:
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qstring.h:62:22: string: No such file or directory
In file included from ../../Qt/4.4.0/include/QtCore/qstring.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel/qobject.h:50,
from ../../Qt/4.4.0/include/QtCore/qobject.h:1,
from ../../Qt/4.4.0/include/QtCore/../../src/corelib/kernel
...............
../../Qt/4.4.0/include/QtCore/../../src/corelib/tools/qvector.h:376: error: `qMalloc' cannot be used as a function
mingw32-make[1]: *** [debug/hello.o] Error 1
mingw32-make[1]: Leaving directory `C:/wp_Cpp/hello'
mingw32-make: *** [debug] Error 2
Bookmarks