QTCreator Not Building (Windows x64, MinGW) - c++

I'm having a problem when I try building an application with QTCreater.
This is the error I get:
QT Compile Output:
12:40:01: Running steps for project untitled2...
12:40:01: Starting: "C:\Qt\4.8.5\bin\qmake.exe" C:\Users\user\Desktop\untitled2\untitled2.pro -r -spec win32-g++ "CONFIG+=declarative_debug"
12:40:01: The process "C:\Qt\4.8.5\bin\qmake.exe" exited normally.
12:40:01: Starting: "C:\MinGW-back\bin\mingw32-make.exe"
C:/MinGW-back/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory `C:/Users/user/Desktop/build-untitled2-Unnamed-Debug'
c:\Qt\4.8.5\bin\uic.exe ..\untitled2\mainwindow.ui -o ui_mainwindow.h
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.8.5\include\QtCore" -I"..\..\..\..\Qt\4.8.5\include\QtGui" -I"..\..\..\..\Qt\4.8.5\include" -I"..\..\..\..\Qt\4.8.5\include\ActiveQt" -I"debug" -I"." -I"..\untitled2" -I"." -I"..\..\..\..\Qt\4.8.5\mkspecs\win32-g++" -o debug\main.o ..\untitled2\main.cpp
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.8.5\include\QtCore" -I"..\..\..\..\Qt\4.8.5\include\QtGui" -I"..\..\..\..\Qt\4.8.5\include" -I"..\..\..\..\Qt\4.8.5\include\ActiveQt" -I"debug" -I"." -I"..\untitled2" -I"." -I"..\..\..\..\Qt\4.8.5\mkspecs\win32-g++" -o debug\mainwindow.o ..\untitled2\mainwindow.cpp
C:\Qt\4.8.5\bin\moc.exe -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.8.5\include\QtCore" -I"..\..\..\..\Qt\4.8.5\include\QtGui" -I"..\..\..\..\Qt\4.8.5\include" -I"..\..\..\..\Qt\4.8.5\include\ActiveQt" -I"debug" -I"." -I"..\untitled2" -I"." -I"..\..\..\..\Qt\4.8.5\mkspecs\win32-g++" -D__GNUC__ -DWIN32 ..\untitled2\mainwindow.h -o debug\moc_mainwindow.cpp
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I"..\..\..\..\Qt\4.8.5\include\QtCore" -I"..\..\..\..\Qt\4.8.5\include\QtGui" -I"..\..\..\..\Qt\4.8.5\include" -I"..\..\..\..\Qt\4.8.5\include\ActiveQt" -I"debug" -I"." -I"..\untitled2" -I"." -I"..\..\..\..\Qt\4.8.5\mkspecs\win32-g++" -o debug\moc_mainwindow.o debug\moc_mainwindow.cpp
g++ -mthreads -Wl,-subsystem,windows -o debug\untitled2.exe debug/main.o debug/mainwindow.o debug/moc_mainwindow.o -L"c:\Qt\4.8.5\lib" -lmingw32 -lqtmaind -lQtGuid4 -lQtCored4
c:\Qt\4.8.5\lib/libqtmaind.a(qtmain_win.o): In function `WinMain#16':
c:\iwmake\build_mingw_opensource\src\winmain/qtmain_win.cpp:93: undefined reference to `_Unwind_Resume'
c:\iwmake\build_mingw_opensource\src\winmain/qtmain_win.cpp:135: undefined reference to `_Unwind_Resume'
c:\Qt\4.8.5\lib/libqtmaind.a(qtmain_win.o): In function `ZN7QVectorIPcE7reallocEii':
c:\iwmake\build_mingw_opensource\src\winmain/../../include/QtCore/../../src/corelib/tools/qvector.h:512: undefined reference to `_Unwind_Resume'
c:\iwmake\build_mingw_opensource\src\winmain/../../include/QtCore/../../src/corelib/tools/qvector.h:513: undefined reference to `_Unwind_Resume'
c:\Qt\4.8.5\lib/libqtmaind.a(qtmain_win.o):qtmain_win.cpp:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2.exe: error: ld returned 1 exit status
mingw32-make[1]: *** [debug\untitled2.exe] Error 1
mingw32-make[1]: Leaving directory `C:/Users/user/Desktop/build-untitled2-Unnamed-Debug'
mingw32-make: *** [debug] Error 2
12:40:07: The process "C:\MinGW-back\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project untitled2 (kit: Unnamed)
When executing step 'Make'
12:40:07: Elapsed time: 00:07.
I am using QT 4.8.5 that I downloaded from Qt libraries 4.8.5 for Windows (minGW 4.4, 317 MB)
and I am using MinGW that I got from installing Codeblocks MinGW
Please help. Its such a pain setting up QTCreator for Windows.
EDIT:
The solution was to use MinGW 4.4, which I found here: https://docs.google.com/file/d/0B4D8x6CJEmtuczdiQklwMEs4RUU/edit

You must use the MinGW-w64 toolchain shipped with Qt to link to the Qt libraries. Or rebuild Qt yourself with your toolchain, which for 4.8 isn't such a pain as it is for 5.x.
The ABI is different between the compiler versions you're linking, and there is no way to make these compatible.

Related

QT 5.x compilation of Windows software on Linux

I'm trying to compile windows software on linux with qt but each time I try to compile I get the following error:
i686-w64-mingw32.static-g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=gnu++11 -Wall -W -Wextra -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I. -I/mxe/usr/i686-w64-mingw32.static/qt5/include -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtSvg -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtWidgets -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtGui -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtNetwork -I/mxe/usr/i686-w64-mingw32.static/qt5/include/QtCore -Irelease -I. -I/mxe/usr/i686-w64-mingw32.static/qt5/mkspecs/win32-g++ -o release/inventoryview.o View/inventoryview.cpp
In file included from View/inventoryview.cpp:2:0:
./ui_inventoryview.h:21:50: fatal error: Widget\Inventory\inventoryplusbutton.h: No such file or directory
compilation terminated.
Makefile.Release:6009: recipe for target 'release/inventoryview.o' failed
make[1]: Leaving directory '/builds/Skytwoo/qt-test/Synaps-Software'
make[1]: * [release/inventoryview.o] Error 1
Makefile:36: recipe for target 'release' failed
make: * [release] Error 2
I check multiple times and every folder exists.
Everything is run on Ubuntu inside a docker container with this command.
make -f Makefile.Release
As BoBTFish said, you can't have \ (backslashes) in your path. What you have to do here is to change Widget\Inventory\inventoryplusbutton.h into Widget/Inventory/inventoryplusbutton.h and make sure it exists.

Why GDB not loads dlls?

Help me to understand, why simple qt application with dynamically loading libraries run under gdb, but more complex is not. Qt Toolkit I use the for both.
This is how my test application builds (lib and exe afterwards):
C:/devtools/mingw-i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/mingw32-make -f Makefile.Debug
mingw32-make[1]: Entering directory 'C:/Users/juriy/testlib'
g++ -c -pipe -Wall -Wextra -Werror -g -fprofile-arcs -ftest-coverage -O0 -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DTESTLIB_LIBRARY -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I'../../../Qt/4.8.6/include/QtCore' -I'../../../Qt/4.8.6/include/QtGui' -I'../../../Qt/4.8.6/include' -I'../../../Qt/4.8.6/include/ActiveQt' -I'debug' -I'../../../Qt/4.8.6/mkspecs/win32-g++' -o debug/testlib.o testlib.cpp
g++ -export-dynamic -lgcov -coverage -mthreads -shared -Wl,--out-implib,debug/libtestlib.a -o debug/testlib.dll debug/testlib.o -L'c:/Qt/4.8.6/lib' -lQtGuid4 -lQtCored4
C:/devtools/mingw-i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/bin/ld.exe: warning: --export-dynamic is not supported for PE targets, did you mean --export-all-symbols?
mingw32-make[1]: Leaving directory 'C:/Users/juriy/testlib'
g++ -c -pipe -Wall -Wextra -Werror -g -fprofile-arcs -ftest-coverage -O0 -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../../Qt/4.8.6/include/QtCore' -I'../../../Qt/4.8.6/include/QtGui' -I'../../../Qt/4.8.6/include' -I'../testlib' -I'../../../Qt/4.8.6/include/ActiveQt' -I'debug' -I'.' -I'../../../Qt/4.8.6/mkspecs/win32-g++' -o debug/widget.o widget.cpp
g++ -c -pipe -Wall -Wextra -Werror -g -fprofile-arcs -ftest-coverage -O0 -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../../Qt/4.8.6/include/QtCore' -I'../../../Qt/4.8.6/include/QtGui' -I'../../../Qt/4.8.6/include' -I'../testlib' -I'../../../Qt/4.8.6/include/ActiveQt' -I'debug' -I'.' -I'../../../Qt/4.8.6/mkspecs/win32-g++' -o debug/moc_widget.o debug/moc_widget.cpp
g++ -export-dynamic -lgcov -coverage -mthreads -Wl,-subsystem,windows -o debug/test.exe debug/main.o debug/widget.o debug/moc_widget.o -L'c:/Qt/4.8.6/lib' -lmingw32 -lqtmaind -ltestlib -L../testlib/debug -lQtGuid4 -lQtCored4
C:/devtools/mingw-i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/bin/ld.exe: warning: --export-dynamic is not supported for PE targets, did you mean --export-all-symbols?
mingw32-make[1]: Leaving directory 'C:/Users/juriy/test'
And my complex application building:
g++ -c -pipe -Wall -Wextra -Werror -g -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DSIP_LIB -DQWT_DLL -DQT_DLL -DQT_WEBKIT_LIB -DQT_SVG_LIB -DQT_SQL_LIB -DQT_XMLPATTERNS_LIB -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I'../../../../Qt/4.8.6/include/QtCore' -I'../../../../Qt/4.8.6/include/QtNetwork' -I'../../../../Qt/4.8.6/include/QtGui' -I'../../../../Qt/4.8.6/include/QtXml' -I'../../../../Qt/4.8.6/include/QtXmlPatterns' -I'../../../../Qt/4.8.6/include/QtSql' -I'../../../../Qt/4.8.6/include/QtSvg' -I'../../../../Qt/4.8.6/include/QtWebKit' -I'../../../../Qt/4.8.6/include' -I'.' -I'../SIP_Common' -I'../SIP_Qwt' -I'../SIP_Qwt/src' -I'../../../../Qt/4.8.6/include/ActiveQt' -I'debug/mocs' -I'debug/uics' -I'../../../../Qt/4.8.6/mkspecs/win32-g++' -o debug/objs/moc_sbmrscwidget.o debug/mocs/moc_sbmrscwidget.cpp
g++ -export-dynamic -mthreads -shared -Wl,--out-implib,./debug/libWidgets.a -o debug/Widgets.dll object_script.Widgets.Debug -L'c:/Qt/4.8.6/lib' -lCommon -L../SIP_Common/debug -lQwt_4 -L../SIP_Qwt/debug -lQtWebKitd4 -lQtSvgd4 -lQtSqld4 -lQtXmlPatternsd4 -lQtXmld4 -lQtGuid4 -lQtNetworkd4 -lQtCored4
C:/devtools/mingw-i686-4.8.2-release-posix-dwarf-rt_v3-rev3/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.8.2/../../../../i686-w64-mingw32/bin/ld.exe: warning: --export-dynamic is not supported for PE targets, did you mean --export-all-symbols?
Tha last illustrates both library and exe building flags, flags the same.
When gdb starts I see in QtCreator gdb output concrete differencies. For simple app gdb starts to load libs like so:
>=library-loaded,id="C:\\Windows\\system32\\ntdll.dll",target-name="C:\\Windows\\system32\\ntdll.dll",host-name="C:\\Windows\\system32\\ntdll.dll",symbols-loaded="0",thread-group="i1"
sLibrary C:\Windows\system32\ntdll.dll loaded
>=library-loaded,id="C:\\Windows\\syswow64\\kernel32.dll",target-name="C:\\Windows\\syswow64\\kernel32.dll",host-name="C:\\Windows\\syswow64\\kernel32.dll",symbols-loaded="0",thread-group="i1"
sLibrary C:\Windows\syswow64\kernel32.dll loaded
>=library-loaded,id="C:\\Windows\\syswow64\\KernelBase.dll",target-name="C:\\Windows\\syswow64\\KernelBase.dll",host-name="C:\\Windows\\syswow64\\KernelBase.dll",symbols-loaded="0",thread-group="i1"
sLibrary C:\Windows\syswow64\KernelBase.dll loaded
>=library-loaded,id="C:\\Users\\juriy\\testlib\\debug\\testlib.dll",target-name="C:\\Users\\juriy\\testlib\\debug\\testlib.dll",host-name="C:\\Users\\juriy\\testlib\\debug\\testlib.dll",symbols-loaded="0",thread-group="i1"
sLibrary C:\Users\juriy\testlib\debug\testlib.dll loaded
But when more complex one starts up, gdb omits the loading and outputs following instead:
>=thread-exited,id="1",group-id="i1"
sThread 1 in group i1 exited
>=thread-group-exited,id="i1"
sThread group i1 exited
>19^error,msg="During startup program exited with code 0xc0000022."
dCOOKIE FOR TOKEN 19 ALREADY EATEN (InferiorRunOk). TWO RESPONSES FOR ONE COMMAND?
dNOTE: INFERIOR EXITED
dState changed from InferiorRunOk(11) to InferiorExitOk(16) [master]
dState changed from InferiorExitOk(16) to InferiorShutdownOk(19) [master]
dState changed from InferiorShutdownOk(19) to EngineShutdownRequested(20) [master]
dQUEUE: SHUTDOWN ENGINE
sExecutable failed: During startup program exited with code 0xc0000022.
PS. There is some warnings about CROSS_COMPILE, should I ignore this?
Here some same question, but it a bit useless because of I couldn't see the decision.

Qt5 Windows static linking error

I'm trying to build a Qt5 application on Windows, but I was not able to compile and link it correctly.
There aren't any "direct" compiler or linker errors, but when I run it Windows says that Qt5Core.dll is missing.
Beforehand I compiled statically Qt5 using
configure -static
mingw32-make
And everything went fine.
Here is my project file (qmake):
TEMPLATE = app
QT += network widgets # core gui included by default
CONFIG += static c++11
DEFINES += VERSION=\\\"1.0\\\"
win32 {
INCLUDEPATH += $$PWD/../../include
LIBS += -L$$PWD/../../include/ -lluacppinterface -llua
}
SOURCES += main.cpp\
Client.cpp\
Updater.cpp\
Header.cpp
HEADERS += Client.h\
Updater.h\
Header.h\
Compiler output from Qt Creator:
20:06:22: Running steps for project FireClient_qmake...
20:06:22: Starting: "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" clean
C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile.Release clean
mingw32-make[1]: Entering directory 'C:/Users/User1/Qt_projs/build-FireClient_qmake-Desktop_Qt_5_4_0_MinGW_32bit-Release'
del release\moc_Client.cpp release\moc_Updater.cpp
del release\main.o release\Client.o release\Updater.o release\Header.o release\moc_Client.o release\moc_Updater.o
mingw32-make[1]: Leaving directory 'C:/Users/User1/Qt_projs/build-FireClient_qmake-Desktop_Qt_5_4_0_MinGW_32bit-Release'
C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile.Debug clean
mingw32-make[1]: Entering directory 'C:/Users/User1/Qt_projs/build-FireClient_qmake-Desktop_Qt_5_4_0_MinGW_32bit-Release'
del debug\moc_Client.cpp debug\moc_Updater.cpp
Impossibile trovare C:\Users\User1\Qt_projs\build-FireClient_qmake-Desktop_Qt_5_4_0_MinGW_32bit-Release\debug\moc_Client.cpp
del debug\main.o debug\Client.o debug\Updater.o debug\Header.o debug\moc_Client.o debug\moc_Updater.o
Impossibile trovare C:\Users\User1\Qt_projs\build-FireClient_qmake-Desktop_Qt_5_4_0_MinGW_32bit-Release\debug\main.o
mingw32-make[1]: Leaving directory 'C:/Users/User1/Qt_projs/build-FireClient_qmake-Desktop_Qt_5_4_0_MinGW_32bit-Release'
20:06:22: The process "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" exited normally.
20:06:22: Configuration unchanged, skipping qmake step.
20:06:22: Starting: "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" -j9
C:/Qt/Tools/mingw491_32/bin/mingw32-make -f Makefile.Release
mingw32-make[1]: Entering directory 'C:/Users/User1/Qt_projs/build-FireClient_qmake-Desktop_Qt_5_4_0_MinGW_32bit-Release'
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DVERSION=\"1.0\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\FireClient_qmake -I"..\..\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtWidgets" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtNetwork" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++" -o release\main.o ..\FireClient_qmake\main.cpp
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DVERSION=\"1.0\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\FireClient_qmake -I"..\..\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtWidgets" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtNetwork" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++" -o release\Client.o ..\FireClient_qmake\Client.cpp
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DVERSION=\"1.0\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\FireClient_qmake -I"..\..\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtWidgets" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtNetwork" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++" -o release\Updater.o ..\FireClient_qmake\Updater.cpp
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DVERSION=\"1.0\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\FireClient_qmake -I"..\..\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtWidgets" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtNetwork" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++" -o release\Header.o ..\FireClient_qmake\Header.cpp
C:\Qt\5.4\mingw491_32\bin\moc.exe -DUNICODE -DVERSION=\"1.0\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -D__GNUC__ -DWIN32 -IC:/Qt/5.4/mingw491_32/mkspecs/win32-g++ -IC:/Users/User1/Qt_projs/FireClient_qmake -IC:/Users/User1/include -IC:/Qt/5.4/mingw491_32/include -IC:/Qt/5.4/mingw491_32/include/QtWidgets -IC:/Qt/5.4/mingw491_32/include/QtGui -IC:/Qt/5.4/mingw491_32/include/QtNetwork -IC:/Qt/5.4/mingw491_32/include/QtCore -I. ..\FireClient_qmake\Client.h -o release\moc_Client.cpp
C:\Qt\5.4\mingw491_32\bin\moc.exe -DUNICODE -DVERSION=\"1.0\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -D__GNUC__ -DWIN32 -IC:/Qt/5.4/mingw491_32/mkspecs/win32-g++ -IC:/Users/User1/Qt_projs/FireClient_qmake -IC:/Users/User1/include -IC:/Qt/5.4/mingw491_32/include -IC:/Qt/5.4/mingw491_32/include/QtWidgets -IC:/Qt/5.4/mingw491_32/include/QtGui -IC:/Qt/5.4/mingw491_32/include/QtNetwork -IC:/Qt/5.4/mingw491_32/include/QtCore -I. ..\FireClient_qmake\Updater.h -o release\moc_Updater.cpp
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DVERSION=\"1.0\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\FireClient_qmake -I"..\..\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtWidgets" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtNetwork" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++" -o release\moc_Updater.o release\moc_Updater.cpp
g++ -c -pipe -fno-keep-inline-dllexport -O2 -std=c++0x -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DVERSION=\"1.0\" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I..\FireClient_qmake -I"..\..\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtWidgets" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtGui" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtNetwork" -I"..\..\..\..\Qt\5.4\mingw491_32\include\QtCore" -I"release" -I"." -I"..\..\..\..\Qt\5.4\mingw491_32\mkspecs\win32-g++" -o release\moc_Client.o release\moc_Client.cpp
g++ -Wl,-s -Wl,-subsystem,windows -mthreads -o release\FireClient_qmake.exe release/main.o release/Client.o release/Updater.o release/Header.o release/moc_Client.o release/moc_Updater.o -lglu32 -lopengl32 -lgdi32 -luser32 -lmingw32 -LC:/Qt/5.4/mingw491_32/lib -lqtmain -LC:\mingw491\mingw32\lib -LC:\Utils\icu32_53_1_mingw482\lib -LC:\utils\postgresql\pgsql\lib -LC:\utils\mysql\mysql\lib -LC:\opensll\lib -lshell32 -LC:\Qt\5.4\mingw491_32/lib -LC:/Users/User1/Qt_projs/FireClient_qmake/../../include/ -lluacppinterface -llua -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core
mingw32-make[1]: Leaving directory 'C:/Users/User1/Qt_projs/build-FireClient_qmake-Desktop_Qt_5_4_0_MinGW_32bit-Release'
20:06:30: The process "C:\Qt\Tools\mingw491_32\bin\mingw32-make.exe" exited normally.
20:06:30: Elapsed time: 00:08.
However, both Windows and the Dependency Walker say that my application depends on Qt5Core.dll and other dynamic Qt libraries. Why doesn't qmake link Qt static libraries instead?
Solved, Qt creator's kit was pointing to the dynamic version of this qmake.

Netbeans 7.3.1 with Qt 4.8.5 - Not able to compile

I have Netbeans 7.3.1 installed with MingW. I have built several c/c++ terminal apps with this so I am pretty sure it works.
My difficulty is with QT. I can't seem to get my Qt app (default main.cpp) to compile.
I installed Qt 5.1.1 for Windows 32-bit (VS 2010, 505 MB) and Qt Creator 2.8.1 for Windows (53 MB) (Info) from here http://qt-project.org/downloads.
In netbeans I created a new c++ -> qt application. On the project properties I point the c++ compiler to the qt includes root and the linker to the qt libraries. When I try to clean and build the default main.cpp:
#include
int main(int argc, char *argv[]) {
// initialize resources, if needed
// Q_INIT_RESOURCE(resfile);
QApplication app(argc, argv);
return app.exec();
}
This is what I get. Not exactly sure what this error means:
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE=/C/Qt/4.8.5/bin/qmake.exe SUBPROJECTS= .clean-conf
make.exe[1]: Entering directory /c/Users/Jones/Desktop/QtApplication_1'
/C/Qt/4.8.5/bin/qmake.exe VPATH=. -spec win32-g++ -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
/C/msys/1.0/bin/make.exe -f nbproject/qt-Debug.mk distclean
make.exe[2]: Entering directory/c/Users/Jones/Desktop/QtApplication_1'
rm moc_HelloWorld.cpp
rm ui_HelloWorld.h
rm build/Debug/MinGW-Windows/HelloWorld.o build/Debug/MinGW-Windows/main.o build/Debug/MinGW-Windows/moc_HelloWorld.o
rm build/Debug/MinGW-Windows/QtApplication_1_resource_res.o
rm dist/Debug/MinGW-Windows/QtApplication_1.exe
rm: cannot remove dist/Debug/MinGW-Windows/QtApplication_1.exe': No such file or directory
make.exe[2]: [distclean] Error 1 (ignored)
rm: cannot removeqttmp-Debug.mk': No such file or directory
make.exe[2]: [distclean] Error 1 (ignored)
rm qttmp-Debug.mk
make.exe[2]: Leaving directory /c/Users/Jones/Desktop/QtApplication_1'
make.exe[1]: Leaving directory/c/Users/Jones/Desktop/QtApplication_1'
CLEAN SUCCESSFUL (total time: 663ms)
"/C/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE=/C/Qt/4.8.5/bin/qmake.exe SUBPROJECTS= .build-conf
make.exe[1]: Entering directory /c/Users/Jones/Desktop/QtApplication_1'
/C/Qt/4.8.5/bin/qmake.exe VPATH=. -spec win32-g++ -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
"/C/msys/1.0/bin/make.exe" -f nbproject/qt-Debug.mk dist/Debug/MinGW-Windows/QtApplication_1.exe
make.exe[2]: Entering directory/c/Users/Jones/Desktop/QtApplication_1'
c:/Qt/4.8.5/bin/uic.exe ../QtApplication_1/HelloWorld.ui -o ui_HelloWorld.h
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../../../Qt/4.8.5/include/QtCore' -I'../../../../Qt/4.8.5/include/QtGui' -I'../../../../Qt/4.8.5/include' -I'../../../../Qt/4.8.5/include' -I'../../../../Qt/4.8.5/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'../../../../Qt/4.8.5/mkspecs/win32-g++' -o build/Debug/MinGW-Windows/HelloWorld.o ../QtApplication_1/HelloWorld.cpp
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../../../Qt/4.8.5/include/QtCore' -I'../../../../Qt/4.8.5/include/QtGui' -I'../../../../Qt/4.8.5/include' -I'../../../../Qt/4.8.5/include' -I'../../../../Qt/4.8.5/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'../../../../Qt/4.8.5/mkspecs/win32-g++' -o build/Debug/MinGW-Windows/main.o main.cpp
C:/Qt/4.8.5/bin/moc.exe -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../../../Qt/4.8.5/include/QtCore' -I'../../../../Qt/4.8.5/include/QtGui' -I'../../../../Qt/4.8.5/include' -I'../../../../Qt/4.8.5/include' -I'../../../../Qt/4.8.5/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'../../../../Qt/4.8.5/mkspecs/win32-g++' -D_GNUC_ -DWIN32 ../QtApplication_1/HelloWorld.h -o moc_HelloWorld.cpp
g++ -c -pipe -g -frtti -fexceptions -mthreads -Wall -Wextra -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN -I'../../../../Qt/4.8.5/include/QtCore' -I'../../../../Qt/4.8.5/include/QtGui' -I'../../../../Qt/4.8.5/include' -I'../../../../Qt/4.8.5/include' -I'../../../../Qt/4.8.5/include/ActiveQt' -I'.' -I'.' -I'nbproject' -I'.' -I'../../../../Qt/4.8.5/mkspecs/win32-g++' -o build/Debug/MinGW-Windows/moc_HelloWorld.o moc_HelloWorld.cpp
windres -i QtApplication_1_resource.rc -o build/Debug/MinGW-Windows/QtApplication_1_resource_res.o --include-dir=. -DUNICODE -DQT_DLL -DQT_GUI_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -DQT_NEEDS_QMAIN
g++ -mthreads -Wl,-subsystem,windows -o dist/Debug/MinGW-Windows/QtApplication_1.exe build/Debug/MinGW-Windows/HelloWorld.o build/Debug/MinGW-Windows/main.o build/Debug/MinGW-Windows/moc_HelloWorld.o -L'c:/Qt/4.8.5/lib' -lmingw32 -lqtmaind build/Debug/MinGW-Windows/QtApplication_1_resource_res.o -lQt3Support4 -lQt3Supportd4 -lQtCLucene4 -lQtCLucened4 -lQtCore4 -lQtCored4 -lQtDeclarative4 -lQtDeclaratived4 -lQtDesigner4 -lQtDesignerComponents4 -lQtDesignerComponentsd4 -lQtDesignerd4 -lQtGui4 -lQtGuid4 -lQtHelp4 -lQtHelpd4 -lQtMultimedia4 -lQtMultimediad4 -lQtNetwork4 -lQtNetworkd4 -lQtOpenGL4 -lQtOpenGLd4 -lQtScript4 -lQtScriptTools4 -lQtScriptToolsd4 -lQtScriptd4 -lQtSql4 -lQtSqld4 -lQtSvg4 -lQtSvgd4 -lQtTest4 -lQtTestd4 -lQtWebKit4 -lQtWebKitd4 -lQtXml4 -lQtXmlPatterns4 -lQtXmlPatternsd4 -lQtXmld4 -lphonon4 -lphonond4 -lQtGuid4 -lQtCored4
Warning: .drectve /DEFAULTLIB:"uuid.lib" /DEFAULTLIB:"uuid.lib" /FAILIFMISMATCH:"_MSC_VER=1600" /FAILIFMISMATCH:"_ITERATOR_DEBUG_LEVEL=2" /DEFAULTLIB:"msvcprtd" /DEFAULTLIB:"MSVCRTD" /DEFAULTLIB:"OLDNAMES" ' unrecognized
c:/Qt/4.8.5/lib/qtmaind.lib(tmp/obj/debug_shared/qtmain_win.obj):(.text[?realloc#?$QVector#PAD##AAEXHH#Z]+0x19): undefined reference to__security_cookie'
c:/Qt/4.8.5/lib/qtmaind.lib(tmp/obj/debug_shared/qtmain_win.obj):(.text[?realloc#?$QVector#PAD##AAEXHH#Z]+0x240): undefined reference to _CxxThrowException#8'
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: c:/Qt/4.8.5/lib/qtmaind.lib(tmp/obj/debug_shared/qtmain_win.obj): bad reloc address 0x240 in section.text[?realloc#?$QVector#PAD##AAEXHH#Z]'
collect2.exe: error: ld returned 1 exit status
make.exe[2]: * [dist/Debug/MinGW-Windows/QtApplication_1.exe] Error 1
make.exe[2]: Leaving directory /c/Users/Jones/Desktop/QtApplication_1'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory/c/Users/Jones/Desktop/QtApplication_1'
make.exe": * [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 5s)
I also added the path C:\Qt\4.8.5 to the environment variables and restarted the workstation several times. Still no luck.
My workstation is running windows 7 64 bit service pack 1.
You installed Qt for MSVC 2010 but are using MingW as compiler. That won't work. The C++ ABIs of MingW and MSVC are incompatible, thus they cannot be mixed. Thus all C++ libraries (and the main executable) linked together must be built with the same compiler/compiler family. (This does not affect C libraries). You need to either use MSVC or install Qt for MingW.

compiling qt 4.7.3 on mingw with gcc 4.6

I decided to start working on a new C++ project and wanted to use the latest version of the Qt framework, which is 4.7.3. I also decided to use gcc 4.6 found [here] (http://www.equation.com/servlet/equation.cmd?fa=fortran) . The compiler seems to compile simple c++ files using the new c++0x standard.
The problem I'm having, is that I can't seem to be able to compile Qt 4.7.3 on MinGW with gcc 4.6. I keep getting the following error:
cd src\corelib\ && mingw32-make -f Makefile
mingw32-make[1]: Entering directory `D:/__dev/Qt/4.7.3/src/corelib'
mingw32-make -f Makefile.Debug all
mingw32-make[2]: Entering directory `D:/__dev/Qt/4.7.3/src/corelib'
D:\__dev\Qt\4.7.3\bin\moc.exe -DQT_SHARED -DQT_THREAD_SUPPORT -DUNICODE -DQT_LARGEFILE_SUPPORT -DQT_BUILD_CORE_LIB -DQT_NO_USING_N
AMESPACE -DQT_MAKEDLL -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_FAST_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -D_USE_MATH
_DEFINES -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_DLL -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -
DQT_HAVE_SSE2 -I"..\..\include" -I"..\..\include\QtCore" -I"tmp\rcc\debug_shared" -I"tmp" -I"global" -I"..\..\tools\shared" -I"..\
3rdparty\zlib" -I"..\3rdparty\harfbuzz\src" -I"..\3rdparty\md5" -I"..\3rdparty\md4" -I"..\..\include\ActiveQt" -I"tmp\moc\debug_sh
ared" -I"..\..\mkspecs\win32-g++" -D__GNUC__ -DWIN32 animation\qabstractanimation.h -o tmp\moc\debug_shared\moc_qabstractanimation
.cpp
g++ -c -include tmp\obj\debug_shared\qt_pch.h -g -Wall -frtti -fexceptions -mthreads -DQT_SHARED -DQT_THREAD_SUPPORT -DUNICODE -DQ
T_LARGEFILE_SUPPORT -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_MAKEDLL -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_FAS
T_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -D_USE_MATH_DEFINES -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_DLL -DQT_HA
VE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"..\..\include" -I"..\..\include\QtCore" -I"tmp\rcc\debug_s
hared" -I"tmp" -I"global" -I"..\..\tools\shared" -I"..\3rdparty\zlib" -I"..\3rdparty\harfbuzz\src" -I"..\3rdparty\md5" -I"..\3rdpa
rty\md4" -I"..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\qabstractanimatio
n.o animation\qabstractanimation.cpp
animation\qabstractanimation.cpp:896:38: fatal error: moc_qabstractanimation.cpp: No such file or directory
compilation terminated.
mingw32-make[2]: *** [tmp/obj/debug_shared/qabstractanimation.o] Error 1
mingw32-make[2]: Leaving directory `D:/__dev/Qt/4.7.3/src/corelib'
mingw32-make[1]: *** [debug-all] Error 2
mingw32-make[1]: Leaving directory `D:/__dev/Qt/4.7.3/src/corelib'
mingw32-make: *** [sub-corelib-make_default-ordered] Error 2
Removing the line also doesn't help, cause it'll fail at another file. Now I'm kinda stuck though, because I don't know why it can't find the file.
I removed the source code i had, and installed the windows version of qt 4.7.3, but i can't compile with a program with gcc 4.6, something about undefined methods (probably because the libs are compiled with gcc 4.4, or so i think). So i decided to rebuild qt it with gcc 4.6. Now I get the following errors:
g++ -c -include tmp\obj\debug_shared\qt_pch.h -g -Wall -frtti -fexceptions -mthreads -DQT_SHARED -DQT_THREAD_SUPPORT -DUNICODE -DQ
T_LARGEFILE_SUPPORT -DQT_BUILD_CORE_LIB -DQT_NO_USING_NAMESPACE -DQT_MAKEDLL -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_FAS
T_OPERATOR_PLUS -DQT_USE_FAST_CONCATENATION -D_USE_MATH_DEFINES -DQLIBRARYINFO_EPOCROOT -DHB_EXPORT=Q_CORE_EXPORT -DQT_DLL -DQT_HA
VE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"..\..\include" -I"..\..\include\QtCore" -I"tmp\rcc\debug_s
hared" -I"tmp" -I"global" -I"..\..\tools\shared" -I"..\3rdparty\zlib" -I"..\3rdparty\harfbuzz\src" -I"..\3rdparty\md5" -I"..\3rdpa
rty\md4" -I"..\..\include\ActiveQt" -I"tmp\moc\debug_shared" -I"..\..\mkspecs\win32-g++" -o tmp\obj\debug_shared\moc_qnamespace.o
tmp\moc\debug_shared\moc_qnamespace.cpp
tmp\moc\debug_shared\moc_qnamespace.cpp:196:16: error: 'WMouseNoMask' is not a member of 'Qt'
tmp\moc\debug_shared\moc_qnamespace.cpp:197:16: error: 'WDestructiveClose' is not a member of 'Qt'
[the list continues]
tmp\moc\debug_shared\moc_qnamespace.cpp:1022:17: error: 'PaletteLinkVisited' is not a member of 'Qt'
tmp\moc\debug_shared\moc_qnamespace.cpp:1023:17: error: 'X11ParentRelative' is not a member of 'Qt'
make[2]: *** [tmp/obj/debug_shared/moc_qnamespace.o] Error 1
make[2]: Leaving directory `D:/__dev/Qt/4.7.3/src/corelib'
make[1]: *** [debug-all] Error 2
make[1]: Leaving directory `D:/__dev/Qt/4.7.3/src/corelib'
make: *** [sub-corelib-make_default-ordered] Error 2
Does qabstractanimation have the QOBJECT macro in the declaration? Moc.exe may not be generating the file moc_qabstractanimation.cpp because it doesn't see the macro.