PDA

View Full Version : compiler and app error with qtcreator 2.3 and 4..7.4



creatio.x
5th September 2011, 08:14
I've recently update my QtCreator and Qt installation to 2.3 and 4.7.4 respectively. However, ever since I upgraded I can't compile or run my older programs (exit with code: 1073741511). When I compile I get the following error:


In file included from d:\__dev\qt\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/postypes.h:42,
from d:\__dev\qt\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/bits/char_traits.h:42,
from d:\__dev\qt\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/string:42,
from d:\__dev\Qt\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qstring.h:60,
from d:\__dev\Qt\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qobject.h:48,
from d:\__dev\Qt\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtCore/qcoreapplication.h:45,
from d:\__dev\Qt\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtGui/qapplication.h:45,
from d:\__dev\Qt\QtSDK\Desktop\Qt\4.7.4\mingw\include/QtGui/QApplication:1,
from ..\apache-gui\main.cpp:1:
d:\__dev\qt\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:159: error: '::swprintf' has not been declared
d:\__dev\qt\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/include/c++/cwchar:166: error: '::vswprintf' has not been declared
mingw32-make[1]: Leaving directory `C:/Users/creatio/Desktop/work/C++/apache-gui/apache-gui-build-desktop'
mingw32-make[1]: *** [debug/main.o] Error 1
mingw32-make: *** [debug] Error 2
The process "D:\__dev\Qt\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.

mvuori
5th September 2011, 15:11
As far as I see, this page may have a solution to you:
http://stackoverflow.com/questions/6699734/qt-creator-compilation-error-swprintf-and-vswprintf-has-not-been-declared

creatio.x
6th September 2011, 09:16
Thanks, it set me in the right direction. I ended up just building Qt from source instead of the SDK libraries. The problem I'm having right now is that the application has the QWindowsStyle. It doesn't automatically set it to QWindowsVistaStyle. I've tried setting it with QApplication::setStyle(new QWindowsVistaStyle), but it gives me the QWindowsVistaStyle in undefined error.


#include <QtGui/QApplication>
#include <QWindowsVistaStyle>
#include "mainwindow.h"

int main(int argc, char *argv[])
{
QApplication::setStyle("windowsxp");
QApplication a(argc, argv);
MainWindow w;
w.show();

return a.exec();
}