Qt and gcc 4.7.0 -> Parse error at "std" problem
i've compiled qt and use the following to configure:
configure.exe -confirm-license -opensource -static -stl -rtti -exceptions -arch windows
-platform win32-g++ -debug-and-release -no-qt3support -no-phonon-backend -no-webkit -no-script -no-scripttools
and now can not compile qt-apps. i use the actual mingw (32bit) with gcc 4.7.0.
compilation ends with:
C:/Development/MinGW/lib/gcc/mingw32/4.7.0/include/c++/bits/stl_relops.:68: Parse error at "std"
what is the reason for that error?
i am thankfull for some hints.
no one knows this error or has an idea!?
Only think that comes to mind is to drop the -stl flag from configure. I have not run into that one, though, and on those rare occasions I compile for Windows, I use MSVC, so I certainly do lack knowledge here..
i found out that building 'pure' qt-app (without stl) is possible.
but when i want to use stl, add the following entries to the .pro-file like:
INCLUDEPATH += C:/Development/MinGW/include
and include e.g. <string> (std::string) in a simple class,
compilation ends with the error.
also searching with google revealed that this error is not a common
one and i did not find a solution for it.
in the project .pro-file you need to add -I and -L for includes and libs.
when i remove all the -I and -L, i get the "Parse error at std"
found by trial!
@CONFIG += debug
TEMPLATE = app
TARGET = QtApplication
DEPENDPATH += .
QT += core gui
HEADERS += qttest.h
SOURCES += main.cpp qttest.cpp
INCLUDEPATH += -IC:/Development/MinGW/include
LIBS += -LC:/Development/MinGW/lib
FORMS += qttest.ui
RESOURCES += @
thanks to all who have read this post and did not have any idea!
Sorry that you didn't get more helpful replies! Obviously nobody had a solid answer to give, or they would have, I'm sure. Hopefully your posted solution can help others who might run into the same problem at some point.
after editing the .pro-file like above i found include-entries in the Makefile.Debug like this
how can i avoid this?
also can not remove all -I in .pro-file cause of the above error.
(i use eclipse)
try to compile qt 4.8.3 with (latest mingw) gcc 4.7.0 on windows 7 and the following configuration:
@configure.exe -confirm-license -opensource -platform win32-g++-4.6 -arch windows -qt-style-windowsxp -qt-style-windowsvista -debug-and-release -no-qt3support -no-phonon-backend -no-webkit -no-script -no-scripttools -no-dsp -no-vcproj -no-audio-backend -no-declarative -no-mp -no-s60 -nomake demos -nomake examples
someone who has this problem too?
once again -> "Parse error at std"
what i am doing wrong?
nice greetings to DIGIA!