[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1638
  • Last Modified:

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
0
pmatiasek
Asked:
pmatiasek
  • 3
  • 3
1 Solution
 
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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
 
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

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now