QT - minGW compilation problem

Hello,

I'm trying to start with QT. I have installed QT 4.1.1 OpenSource on Windows with MinGW. When I tried to compile basic application "Hello World!" this errors appeared during nmake (the same problem is with mingw32-make.exe):


Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

"c:\Program Files\Microsoft Visual Studio 8\VC\bin\nmake.exe" -f Makefil
e.Release

Microsoft (R) Program Maintenance Utility Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.

g++ -c -O2 -O2 -frtti -fexceptions -Wall -DUNICODE -DQT_LARGEFILE_SUPPOR
T -DQT_DLL -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_THREAD_SUPPORT -DQT_NEE
DS_QMAIN -I"C:/Qt/4.1.1/include/QtCore" -I"C:/Qt/4.1.1/include/QtGui" -I"C:/Qt/4
.1.1/include" -I"." -I"C:/Qt/4.1.1/include/ActiveQt" -I"release" -I"." -I"C:/Qt/
4.1.1/mkspecs/win32-g++" -o release\hello.o hello.cpp
In file included from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/cstdio:52,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/mingw32/bits/c++locale.h:43,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/iosfwd:46,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/bits/stl_algobase.h:70,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/bits/char_traits.h:46,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/string:47,
from C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qstring
.h:42,
from C:/Qt/4.1.1/include/QtCore/qstring.h:1,
from C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qobjec
t.h:30,
from C:/Qt/4.1.1/include/QtCore/qobject.h:1,
from C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qcorea
pplication.h:27,
from C:/Qt/4.1.1/include/QtCore/qcoreapplication.h:1,
from C:/Qt/4.1.1/include/QtGui/../../src/gui/kernel/qapplicatio
n.h:27,
from C:/Qt/4.1.1/include/QtGui/qapplication.h:1,
from hello.cpp:2:
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdio.h:399:23: sys/ty
pes.h: No such file or directory
In file included from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/cstdio:52,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/mingw32/bits/c++locale.h:43,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/iosfwd:46,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/bits/stl_algobase.h:70,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/bits/char_traits.h:46,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/string:47,
from C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qstring
.h:42,
from C:/Qt/4.1.1/include/QtCore/qstring.h:1,
from C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qobjec
t.h:30,
from C:/Qt/4.1.1/include/QtCore/qobject.h:1,
from C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qcorea
pplication.h:27,
from C:/Qt/4.1.1/include/QtCore/qcoreapplication.h:1,
from C:/Qt/4.1.1/include/QtGui/../../src/gui/kernel/qapplicatio
n.h:27,
from C:/Qt/4.1.1/include/QtGui/qapplication.h:1,
from hello.cpp:2:
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdio.h:405: error: `o
ff64_t' has not been declared
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdio.h:412: error: ex
pected init-declarator before "ftello64"
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdio.h:412: error: ex
pected `,' or `;' before "ftello64"
In file included from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/cwchar:54,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/bits/postypes.h:46,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/iosfwd:50,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/bits/stl_algobase.h:70,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/bits/char_traits.h:46,
from c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/
c++/3.4.2/string:47,
from C:/Qt/4.1.1/include/QtCore/../../src/corelib/tools/qstring
.h:42,
from C:/Qt/4.1.1/include/QtCore/qstring.h:1,
from C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qobjec
t.h:30,
from C:/Qt/4.1.1/include/QtCore/qobject.h:1,
from C:/Qt/4.1.1/include/QtCore/../../src/corelib/kernel/qcorea
pplication.h:27,
from C:/Qt/4.1.1/include/QtCore/qcoreapplication.h:1,
from C:/Qt/4.1.1/include/QtGui/../../src/gui/kernel/qapplicatio
n.h:27,
from C:/Qt/4.1.1/include/QtGui/qapplication.h:1,
from hello.cpp:2:
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:375: error: `_
dev_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:376: error: `_
ino_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:377: error: `_
mode_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:381: error: `_
dev_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:382: error: `_
off_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:391: error: `_
dev_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:392: error: `_
ino_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:393: error: `_
mode_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:397: error: `_
dev_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:398: error: `_
off_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:407: error: `_
dev_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:408: error: `_
ino_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:413: error: `_
dev_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:422: error: `_
dev_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:423: error: `_
ino_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:424: error: `_
mode_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:428: error: `_
dev_t' does not name a type
c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/wchar.h:429: error: `_
off_t' does not name a type
hello.cpp:3:21: warning: extra tokens at end of #include directive
hello.cpp: In function `int qMain(int, char**)':
hello.cpp:7: error: expected primary-expression before '/' token
hello.cpp:7: error: expected primary-expression before '/' token
hello.cpp:7: error: `create' undeclared (first use this function)
hello.cpp:7: error: (Each undeclared identifier is reported only once for each f
unction it appears in.)
hello.cpp:7: error: expected `;' before "the"
hello.cpp:9: error: expected primary-expression before '/' token
hello.cpp:9: error: expected primary-expression before '/' token
hello.cpp:9: error: expected `;' before "the"
hello.cpp:11: error: expected primary-expression before '/' token
hello.cpp:11: error: expected primary-expression before '/' token
hello.cpp:11: error: `it' undeclared (first use this function)
hello.cpp:11: error: expected `;' before "defines"
hello.cpp:13: error: expected primary-expression before '/' token
hello.cpp:13: error: expected primary-expression before '/' token
hello.cpp:13: error: `we' undeclared (first use this function)
hello.cpp:13: error: expected `;' before "need"
hello.cpp:15: error: expected primary-expression before '/' token
hello.cpp:15: error: expected primary-expression before '/' token
hello.cpp:15: error: `event' undeclared (first use this function)
hello.cpp:15: error: expected `;' before "loop"
hello.cpp:17:3: warning: no newline at end of file
NMAKE : fatal error U1077: 'c:\MinGW\bin\g++.EXE' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio 8\VC\bin\n
make.exe"' : return code '0x2'
Stop.


Does anybody know where can be a problem?

Takanks a lot.

Mates
pmatiasekAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AxterCommented:
Hi pmatiasek,
Please include the hello.cpp source code.

David Maisonave (Axter)
Cheers!
0
pmatiasekAuthor Commented:
Here is the hello.cpp:

//CODE: hello.cpp  
#include <qapplication.h> //QApplication  
#include <qlabel.h> / / QLabel  
 
int main(int argc, char * argv [])  
{  
   / / create the application object and initialize it.  
        QApplication app(argc, argv);  
   / / create the main object/widget required to receive message  
        QLabel * lbl = new QLabel ("Hello World! ", 0);  
   / / it defines the main object/widget  
        app.setMainWidget(lbl);  
   / / we need show it (required)  
        lbl->show ();  
   / / event loop (required)  
        return app.exec ();  
}
0
jkrCommented:
That basically boils down to

c:/MinGW/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stdio.h:399:23: sys/types.h: No such file or directory

Check if you have that file at the location where the compiler expects it to be.
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

pmatiasekAuthor Commented:
Hi,

there is no types.h on my PC. How can I get it? Does it mean that my MinGW instalation is not complete? QT installed it by itself.

Mates
0
jkrCommented:
>>there is no types.h on my PC. How can I get it? Does it mean that my MinGW instalation is not complete?

Yes, it seems so. Get the corresponding MinGW package, unzip the archive and copy the whole 'sys' directory under 'include' to your 'include' directory.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
pmatiasekAuthor Commented:
I Had a Trojan which didn't allow me to create any folder with name "SYS".

Thanks for help.
0
jkrCommented:
You''re most welcome. Trojans are plain ugly. *knockingonwood*
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.