QtSDK first compile error - qt

I've downloaded the QtSDK for windows and installed it.
I'm using QtCreator to run their test program but run into this problem:
17:03:30: Running build steps for project keepintouch...
17:03:30: Configuration unchanged, skipping qmake step.
17:03:30: Starting: "C:\QtSDK\mingw\bin\mingw32-make.exe"
C:/QtSDK/mingw/bin/mingw32-make.exe -f Makefile.Debug
mingw32-make.exe[1]: Entering directory `C:/QtSDK/Examples/QtMobility/keepintouch- build-desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug2'
g++ -c -g -frtti -fexceptions -mthreads -Wall -DUNICODE -DQT_LARGEFILE_SUPPORT -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"..\..\..\Desktop\Qt\4.8.1\mingw\include\QtCore" -I"..\..\..\Desktop\Qt\4.8.1\mingw\include\QtGui" -I"..\..\..\Desktop\Qt\4.8.1\mingw\include" -I"..\..\src\messaging" -I"..\..\src\contacts" -I"..\..\src\contacts\details" -I"..\..\src\contacts\filters" -I"..\..\src\contacts\requests" -I"..\..\..\Desktop\Qt\4.8.1\mingw\include\ActiveQt" -I"debug" -I"..\keepintouch" -I"." -I"..\..\..\Desktop\Qt\4.8.1\mingw\mkspecs\win32-g++" -o debug\addressfinder.o ..\keepintouch\addressfinder.cpp
mingw32-make.exe[1]: Leaving directory `C:/QtSDK/Examples/QtMobility/keepintouch-build- desktop-Qt_4_8_1_for_Desktop_-_MinGW__Qt_SDK__Debug2'
mingw32-make.exe[1]: *** [debug/addressfinder.o] Error 1
mingw32-make.exe: *** [debug] Error 2
17:03:31: The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project keepintouch (target: Desktop)
When executing build step 'Make'

Related

How to make Qt static build run without install vc_redist.x64.exe

I want to build Qt 5.10.1 using MSVC2015, and without MSVC Runtime.
Followed http://amin-ahmadi.com/2016/09/22/how-to-build-qt-5-7-statically-using-msvc14-microsoft-visual-studio-2015/
Configure:
configure -static -debug-and-release -prefix
"C:\Qt\5.10.1-static-msvc2015" -platform win32-msvc2015 -qt-zlib
-qt-pcre -qt-libpng -qt-libjpeg -qt-freetype -opengl desktop -sql-sqlite -sql-odbc -no-openssl -opensource -confirm-license -make libs -nomake tools -nomake examples -nomake tests
modified src\qtbase\mkspecs\common\msvc-desktop.conf change -MD to -MT.
No error during building, but if I don't install MSVC runtime when I run my program will get:
api-ms-win-crt-runtime-l1-1-0.dll missing.
How to make the MSVC static standalone like Mingw static build?
The output of compiling test program:
cl -c -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline
-Zc:strictStrings -Zc:throwingNew -O2 -MT -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -wd4467 -EHsc -DUNICODE -D_UNICODE -DWIN32 -DQT_DEPRECATED_WARNINGS -DQT_NO_DEBUG -DQT_QUICK_LIB -DQT_MULTIMEDIA_LIB -DQT_GUI_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DNDEBUG
If I don't do step 2, the output will be -MD.
So Why the -MT (step 2) didn't work?
If you having any idea or guessing, Please comment.
Update:
Win10 64
No matter I add -static-runtime or not, both can run with without vc_redist
Win 7 32
Qt 5.10.1 compilation passed, but got api-ms-win-core-winrt-l1-1-0.dll is missing when executing the program.
Even I reinstall vc_redist still got the error...
Relate: Why installed vc_redist still gives api-ms-win-core-winrt-l1-1-0.dll is missing
Qt 5.11.1 compilation also passed, but got C1083: 'QtCore/qglobal.h':No such file or directory when building the program.
Compiling Qt sources from Qt 5.5.0 you can pass -static-runtime argument to configure for static runtime.
Changes 5.5.0:
[Windows] Added -static-runtime option.
Config Options:
-static-runtime ...... With -static, use static runtime [no] (Windows only)

How to build QT Project from terminal MacOS X

For example, lets take a default QT widget application that we get. So instead of using QT Creator if we want to build using the terminal then what is the way to do that?
Basically we want to produce the build for the project which actually also contains the dmg file.
Compile output when done using QT Creator shown is below when no change is done :
14:37:04: Running steps for project QTDefaultProj...
14:37:04: Configuration unchanged, skipping qmake step.
14:37:04: Starting: "/usr/bin/make"
make: Nothing to be done for `first'.
14:37:05: The process "/usr/bin/make" exited normally.
14:37:05: Elapsed time: 00:00.
Compile Output after changing the directory :
15:31:50: Running steps for project QTDefaultProj...
15:31:50: Starting: "/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/qmake" /Users/arqam/Desktop/Junk/QTDefaultProj/QTDefaultProj.pro -spec macx-clang CONFIG+=debug CONFIG+=x86_64 CONFIG+=qml_debug
Info: creating stash file /Users/arqam/Desktop/Junk/build-QTDefaultProj-Desktop_Qt_5_10_0_clang_64bit-Debug-2/.qmake.stash
15:31:50: The process "/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/qmake" exited normally.
15:31:50: Starting: "/usr/bin/make" qmake_all
make: Nothing to be done for `qmake_all'.
15:31:51: The process "/usr/bin/make" exited normally.
15:31:51: Starting: "/usr/bin/make"
/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/uic ../QTDefaultProj/mainwindow.ui -o ui_mainwindow.h
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../QTDefaultProj -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o main.o ../QTDefaultProj/main.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../QTDefaultProj -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o mainwindow.o ../QTDefaultProj/mainwindow.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -dM -E -o moc_predefs.h ../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/features/data/dummy.cpp
/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/bin/moc -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB --include ./moc_predefs.h -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -I/Users/arqam/Desktop/Junk/QTDefaultProj -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1 -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/8.1.0/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/usr/include -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib ../QTDefaultProj/mainwindow.h -o moc_mainwindow.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -c -pipe -stdlib=libc++ -g -std=gnu++11 -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wall -W -fPIC -DQT_DEPRECATED_WARNINGS -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../QTDefaultProj -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtWidgets.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtGui.framework/Headers -I../../ImageToCartoon/QT/5.10.0/clang_64/lib/QtCore.framework/Headers -I. -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/OpenGL.framework/Headers -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk/System/Library/Frameworks/AGL.framework/Headers -I. -I../../ImageToCartoon/QT/5.10.0/clang_64/mkspecs/macx-clang -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o moc_mainwindow.o moc_mainwindow.cpp
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -headerpad_max_install_names -arch x86_64 -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -mmacosx-version-min=10.10 -Wl,-rpath,#executable_path/Frameworks -Wl,-rpath,/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -o QTDefaultProj.app/Contents/MacOS/QTDefaultProj main.o mainwindow.o moc_mainwindow.o -F/Users/arqam/Desktop/ImageToCartoon/QT/5.10.0/clang_64/lib -framework QtWidgets -framework QtGui -framework QtCore -framework DiskArbitration -framework IOKit -framework OpenGL -framework AGL
15:31:55: The process "/usr/bin/make" exited normally.
15:31:55: Elapsed time: 00:05.
With help from m7913d I am finally able to build the QT project from terminal without using QT Creator.
So steps are :
Create an empty folder name it as build-debug for example.
Inside your build-debug folder run the following command :
pathToQTDirectory/QT/5.10.0/clang_64/bin/qmake pathToQTProjectFolder/MyProject/
/usr/bin/make qmake_all
/usr/bin/make
If the above doesn't work then try seeing in the QT Creator compiler output the steps involved when you specify a new directory as the build directory.

Qt 5.5.1 msvc2015 build error

I'm trying to build Qt 5.5.1 from sources on Windows 10 with with msvc2015.
It was configured with:
configure.bat -release -opensource -c++11 -no-angle -opengl dynamic -shared -confirm-license -make libs -make tools -nomake examples -platform win32-msvc2015 -target xp -no-iconv -no-fontconfig -no-system-proxies -no-icu -qmake -no-rtti -strip -no-libproxy -no-dbus -no-qml-debug -mp
With this config and every time I try to change -opengl option I get an error without any meaningful message:
cl -c -FIqt_gui_pch.h -Yuqt_gui_pch.h -Fp.pch\release\Qt5Gui_pch.pch -nologo -Zc:wchar_t -FS -Zc:strictStrings -Zc:throwingNew -Os -MD -D_HAS_EXCEPTIONS=0 -MP -W3 -w34100 -w34189 -w44996 -w44456 -w44457 -w44458 -wd4577 -DUNICODE -DWIN32 -DQT_NO_USING_NAMESPACE -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -D_CRT_SECURE_NO_WARNINGS -D_USE_MATH_DEFINES -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_USE_BUNDLED_LIBPNG -DPNG_ARM_NEON_OPT=0 -DQT_ENABLE_HARFBUZZ_NG -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_NO_DYNAMIC_CAST -DNDEBUG -I. -I..\..\include -I..\..\include\QtGui -I..\..\include\QtGui\5.5.1 -I..\..\include\QtGui\5.5.1\QtGui -Itmp -I..\3rdparty\libpng -I..\3rdparty\zlib -I..\3rdparty\harfbuzz-ng\include -I..\3rdparty\zlib -I..\..\include\QtCore\5.5.1 -I..\..\include\QtCore\5.5.1\QtCore -I..\..\include\QtCore -I.moc\release -I..\..\mkspecs\win32-msvc2015 -Fo.obj\release\ #C:\Users\Alex\AppData\Local\Temp\qpixmapcache.obj.5800.148640.jom
moc_qbrush.cpp
moc_qplatformbackingstore.cpp
moc_qopenglshaderprogram.cpp
moc_qpainter.cpp
moc_qpdfwriter.cpp
moc_qvalidator.cpp
qdesktopservices.cpp
moc_qopengltimerquery.cpp
qpixmapcache.cpp
moc_qopenglengineshadermanager_p.cpp
link /NOLOGO /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO /DLL /SUBSYSTEM:WINDOWS,5.01 /VERSION:5.5 /MANIFEST:embed /OUT:..\..\lib\Qt5Gui.dll #C:\Users\Alex\AppData\Local\Temp\Qt5Gui.dll.5800.153390.jom
Creating library ..\..\lib\Qt5Gui.lib and object ..\..\lib\Qt5Gui.exp
copy /y ..\..\lib\Qt5Gui.dll ..\..\bin
1 file(s) copied.
jom: C:\Qt\Qt5.5.1-msvc2015-shared-min\qtbase\Makefile [sub-src-make_first] Error 2
jom: C:\Qt\Qt5.5.1-msvc2015-shared-min\Makefile [module-qtbase-make_first] Error 2
I run Windows 10 under VirtualBox if it matters.
What could be the reason of the error and how to fix it?

Strange Path when compile qt app for qnx

I try to compile my app, QNX and Qt is all set.
in line 3.
C:/QNX650/target/qnx6armle-v7 is in the QNX_TARGET env var, and C:/QNX650/host/win32/x86 is QNX_HOST env var. this is strange they combine together.
Qtcreator, debug mode.this is the only output
qcc -Vgcc_ntoarmv7le -c -Wno-psabi -lang-c++ -g -Wall -W -D_REENTRANT -fPIE -DQT_NO_CLIPBOARD -DHMI_PLUGIN_DEBUG -DQT_QML_DEBUG -DQT_DECLARATIVE_DEBUG -DQT_QUICK_LIB -DQT_QML_LIB -DQT_NETWORK_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/mkspecs/qnx-armv7le-qcc -I../MQueue_Demo -I../MQueue_Demo/qtquick2applicationviewer -I../MQueue_Demo/depends/MQueue/include -I../MQueue_Demo/depends/MQueue/include/native -I../MQueue_Demo/depends/hmi_interfaces -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtQuick -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtQml -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtNetwork -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtGui -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtGui/5.0.2 -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtGui/5.0.2/QtGui -I../../../../QtQNX/Qt5.0.2/5.0.2/qnx_armv7le/include/QtCore -I. -IC:\QNX650\target\qnx6\armle-v7/target/qnx6/usr/include -IC:\QNX650\target\qnx6\armle-v7/target/qnx6/usr/include/freetype2 -I. -o main.obj ../MQueue_Demo/main.cpp
cc: unknown target 'gcc_ntoarmv7le+debug'
cc: no targets defined in C:/QNX650/target/qnx6/armle-v7/host/win32/x86/etc/qcc!
make: *** [main.obj] Error 1
09:46:25: The process "C:\QNX650\host\win32\x86\usr\bin\make.exe" exited with code 2.

QT5-alpha build errors in Ubuntu-Linux 11.10

I tried the instructions of building latest QT5-Alpha(http://qt-project.org/wiki/Qt-5-Alpha
http://qt-project.org/wiki/Building_Qt_5_from_Git)
from GIT,but facing compilation in wayland files
Ubuntu Linux 11.10
__make[4]: Entering directory `/home/xyz/build/newqt5/qt5/qtwayland/src/plugins/platforms/wayland'
g++ -c -pipe -g -fvisibility=hidden -fvisibility-inlines-hidden -D_REENTRANT -Wall -W -fPIC -DQT_NO_LIBUDEV -DQ_PLATFORM_WAYLAND -DQT_NO_WAYLAND_XKB -DQT_WAYLAND_GL_SUPPORT -DQT_WAYLAND_WINDOWMANAGER_SUPPORT -DQ_FONTCONFIGDATABASE -DQT_COMPILES_IN_HARFBUZZ -DQT_PLUGIN -DQT_GUI_LIB -DQT_CORE_LIB -I/home/xyz/build/newqt5/qt5/qtbase/mkspecs/linux-g++ -I. -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore/5.0.0/QtCore -I/home/xyz/build/newqt5/qt5/qtbase/include/QtCore -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui/5.0.0/QtGui -I/home/xyz/build/newqt5/qt5/qtbase/include/QtGui -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport/5.0.0 -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport/5.0.0/QtPlatformSupport -I/home/xyz/build/newqt5/qt5/qtbase/include/QtPlatformSupport -I/home/xyz/build/newqt5/qt5/qtbase/include -I../../../shared -Igl_integration/xcomposite_share -I.moc/debug-shared -o .obj/debug-shared/qwaylandintegration.o qwaylandintegration.cpp
In file included from qwaylandshmwindow.h:45:0,
from qwaylandintegration.cpp:46:
qwaylandwindow.h:112:18: error: ‘wl_callback_listener’ does not name a type
make[4]: *** [.obj/debug-shared/qwaylandintegration.o] Error 1_
Any pointers to overcome this?
Download the alpha source package here: http://releases.qt-project.org/qt5.0/alpha/ and use the steps in README file.
The master in git is NOT what was released as alpha. The build scripts are different. You have to wait for them to add alpha tag to pull it from git. But why not just grab the gz file?

Resources