We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you a podcast all about Citrix Workspace, moving to the cloud, and analytics & intelligence. Episode 2 coming soon!Listen Now

x

QT - minGW compilation problem

pmatiasek
pmatiasek asked
on
Medium Priority
1,704 Views
Last Modified: 2013-11-23
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
Comment
Watch Question

AxterSenior Software Engineer

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

David Maisonave (Axter)
Cheers!

Author

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 ();  
}
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
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.

Author

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
CERTIFIED EXPERT
Top Expert 2012
Commented:
>>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.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
I Had a Trojan which didn't allow me to create any folder with name "SYS".

Thanks for help.
jkr
CERTIFIED EXPERT
Top Expert 2012

Commented:
You''re most welcome. Trojans are plain ugly. *knockingonwood*
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.