Compiling Qt statically on Windows XP and MinGW fail. Is it possible to achieve? - windows

I need to compile Qt statically. I have to do it on a virtual machine running Windows XP. Because of this requirement, I can't use the PowerShell 3.0 script suggested in the wiki page How to build a static Qt for Windows/MinGW (PowerShell 3.0 can't be installed on WinXP).
I tried to read the script and do its work step by step manually.
I added to the end of C:\Qt\5.3\Src\qtbase\mkspecs\win32-g++\qmake.conf file:
# [QT-STATIC-PATCH]
QMAKE_LFLAGS += -static -static-libgcc
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer
DEFINES += QT_STATIC_BUILD
I ran the configuration:
mkdir C:\Qt\5.3\Static-build
cd C:\Qt\5.3\Static-build
..\Src\configure.bat -static -debug-and-release -platform win32-g++ \
-prefix C:\Qt\5.3\Static -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg \
-qt-freetype -opengl desktop -qt-sql-sqlite -no-openssl -opensource \
-confirm-license -make libs -nomake tools -nomake examples -nomake tests
and that seems OK:
This is the Qt for Windows Open Source Edition.
You have already accepted the terms of the license.
Creating qmake...
mingw32-make: Nothing to be done for 'first'.
Running configuration tests...
Environment:
INCLUDE=
Unset
LIB=
Unset
PATH=
C:\Qt\5.3\mingw482_32\bin
C:\Qt\Tools\mingw482_32\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\Program Files\Git\cmd
C:\Program Files\TortoiseGit\bin
C:\Program Files\CMake\bin
C:\Python27
C:\StrawberryPerl\perl\bin
C:\StrawberryPerl\win32
C:\WINDOWS\system32\WindowsPowerShell\v1.0
Configuration:
pcre
debug
compile_examples
Qt Configuration:
minimal-config
small-config
medium-config
large-config
full-config
debug_and_release build_all release
debug
c++11
static
zlib
gif
jpeg
png
freetype
build_all
accessibility
opengl
audio-backend
native-gestures
qpa
iconv
concurrent
QMAKESPEC...................win32-g++ (commandline)
Architecture................i386, features:
Host Architecture...........i386, features:
Maketool....................mingw32-make
Debug build.................yes (combined)
Default build...............debug
Force debug info............no
C++11 support...............yes
Link Time Code Generation...no
Accessibility support.......yes
RTTI support................yes
SSE2 support................yes
SSE3 support................yes
SSSE3 support...............yes
SSE4.1 support..............yes
SSE4.2 support..............yes
AVX support.................yes
AVX2 support................yes
NEON support................no
IWMMXT support..............no
OpenGL support..............yes
Large File support..........yes
NIS support.................no
Iconv support...............yes
Evdev support...............no
Mtdev support...............no
Inotify support.............no
eventfd(7) support..........no
Glib support................no
CUPS support................no
OpenVG support..............no
OpenSSL support.............no
Qt D-Bus support............no
Qt Widgets module support...yes
Qt GUI module support.......yes
QML debugging...............yes
DirectWrite support.........no
Use system proxies..........no
QPA Backends:
GDI.....................yes
Direct2D................no
Third Party Libraries:
ZLIB support............qt
GIF support.............yes
JPEG support............yes
PNG support.............yes
FreeType support........yes
Fontconfig support......no
HarfBuzz-NG support.....no
PCRE support............qt
ICU support.............no
ANGLE...................no
Dynamic OpenGL..........no
Styles:
Windows.................yes
Windows XP..............yes
Windows Vista...........yes
Fusion..................yes
Windows CE..............no
Windows Mobile..........no
Sql Drivers:
ODBC....................no
MySQL...................no
OCI.....................no
PostgreSQL..............no
TDS.....................no
DB2.....................no
SQLite..................yes (qt)
SQLite2.................no
InterBase...............no
Sources are in..............C:\Qt\5.3\Src\qtbase
Build is done in............C:\Qt\5.3\Static-build\qtbase
Install prefix..............C:\Qt\5.3\Static
Headers installed to........C:\Qt\5.3\Static\include
Libraries installed to......C:\Qt\5.3\Static\lib
Arch-dep. data to...........C:\Qt\5.3\Static
Plugins installed to........C:\Qt\5.3\Static\plugins
Library execs installed to..C:\Qt\5.3\Static\bin
QML1 imports installed to...C:\Qt\5.3\Static\imports
QML2 imports installed to...C:\Qt\5.3\Static\qml
Binaries installed to.......C:\Qt\5.3\Static\bin
Arch-indep. data to.........C:\Qt\5.3\Static
Docs installed to...........C:\Qt\5.3\Static\doc
Translations installed to...C:\Qt\5.3\Static\translations
Examples installed to.......C:\Qt\5.3\Static\examples
Tests installed to..........C:\Qt\5.3\Static\tests
WARNING: Using static linking will disable the use of plugins.
Make sure you compile ALL needed modules into the library.
Generating Makefiles...
Qt is now configured for building. Just run mingw32-make.
To reconfigure, run mingw32-make confclean and configure.
But the compilation with mingw32-make failed at some point:
cd qml/ && ( test -e Makefile || c:/Qt/5.3/Static-build/qtbase/bin/qmake.exe C:/Qt/5.3/Src/qtdeclarative/tools/qml/qml.pro -o
Makefile ) && c:/Qt/Tools/mingw482_32/bin/mingw32-make -f Makefile
'QT_PLUGIN_PATH' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Project ERROR: Failed to parse qmlimportscanner output.
Makefile:94: recipe for target 'sub-qml-make_first' failed
mingw32-make[2]: *** [sub-qml-make_first] Error 3
mingw32-make[2]: Leaving directory 'c:/Qt/5.3/Static-build/qtdeclarative/tools'
Makefile:66: recipe for target 'sub-tools-make_first' failed
mingw32-make[1]: *** [sub-tools-make_first] Error 2
mingw32-make[1]: Leaving directory 'c:/Qt/5.3/Static-build/qtdeclarative'
Makefile:101: recipe for target 'module-qtdeclarative-make_first' failed
mingw32-make: *** [module-qtdeclarative-make_first] Error 2
Sorry for the french wording. The interesting point is:
'QT_PLUGIN_PATH' is not recognized as internal or external command, an executable program or a command file
I found other people having the same issue (here) and tried the solution they suggested (from here):
I added
QMAKE_LFLAGS_STATIC_LIB += -static
to qtbase/mkspecs/win32-g++/qmake.conf and added
static:win32: QMAKE_LFLAGS += $$QMAKE_LFLAGS_STATIC_LIB
to qtbase/mkspecs/features/default_post.prf
I still have the error.
So I have 2 questions:
Do you know if it is possible to compile Qt 5.3 on Windows XP with MinGW?
Does someone know how to fix the error 'QT_PLUGIN_PATH' is not recognized [...]?

Ok, for a weird reason, after closing my console, re-opening it and re-trying, it worked :/ I leave this question open in case that someone have a better explanation for "'QT_PLUGIN_PATH' is not recognized [...]" error. Apparently I was not the first to get stuck on this error.

Related

Standalone build of DPDK on Windows fails for examples application

Building the example application skeleton or l2fwd or l3fwd via DPDK meson with option -Dexamples=, creates the binary executable without any warnings or error. But executing the same example as standalone build leads to DPDK build error
C:\dpdk\dpdk-21.02\examples\skeleton>gcc basicfwd.c -include rte_config.h -march=native -IC:/include -Wl,--as-needed -LC:/lib -lrte_cfgfile -lrte_hash -lrte_cmdline -lrte_pci -lrte_ethdev -lrte_meter -lrte_net -lrte_mbuf -lrte_mempool -lrte_rcu -lrte_ring -lrte_eal -lrte_telemetry -lrte_kvargs
In file included from C:/include/rte_eal.h:21,
from basicfwd.c:7:
C:/include/rte_bus.h:22:10: fatal error: sys/queue.h: No such file or directory
#include <sys/queue.h>
^~~~~~~~~~~~~
compilation terminated.
Expectation:
C:\dpdk\dpdk-21.02\examples\skeleton>dir
Directory of C:\dpdk\dpdk-21.02\examples\skeleton
<DIR> .
<DIR> ..
163,348 a.exe
5,458 basicfwd.c
1,511 Makefile
322 meson.build
Steps to reproduce the error
Platform: x86_64, Intel E5 2680 Xeon
OS: windows server 2019
DPDK version: 21.02
Meson version: 0.57.1
Ninja version: 1.10.2
Pkg-config version: 0.26
Steps followed: http://doc.dpdk.org/guides/windows_gsg/index.html
compiler flags: execute pkg-config --cflags --libs libdpdk
There is a difference in the CFLAGS and LDFLAGS when one uses meson meson -Dexamples=l2fwd build and meson build. In the former scenario, the dependency is pulled from DPDK root folder directly and direct link to lib/librte_eal/windows/include. But when DPDK pkg has installed the files under lib/librte_eal/windows/include are not copied over which causes build failure.
Checking meson.build in lib/librte_eal/windows/ reveals the only install is for 'rte_os.h', 'rte_virt2phys.h', and 'rte_windows.h'. Folder 'netinet' and 'sys' are skipped. Based on the update from DPDK maintainer, since DPDK on windows is experimental only validation done is with meson -Dexamples=l2fwd build. Hence as temporary work around is to use -I[DPDK folder]\lib\librte_eal\windows\include\
Note:
Thanks to #stackinside for the comment
working on DPDK patch to plug the missing files.

VLC compile on mac can't find MacOSX.sdk

Following the VLC macOSCompile wiki page. Using the single command build instructions. I'm running 10.14.6 with Xcode 11.3.1 commandline tools, developer signed, etc.
Important note -- my MacOSX.sdk file is located here:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
All is good through build to create makefile, completes bootstrap and runs make. Then I get the following error -- how do I point VLC to the location where my MacOSX.sdk file is located?
IOW how do I set vlc's "contrib environment"?
Please note in the code snip below, that contrib sets the MacOSX.sdk file pointer to the WRONG location - how do I fix?
Do I need to edit something in the vlc source? Thanks. errors:
Setting base environment
Using VLC root dir /Users/GR99/temp/VLC/vlc and triplet x86_64-apple-darwin18
[build] Checking for python3 ...
Python 3.8.1
[build] Building in "/Users/GR99/temp/VLC/vlc/build"
[build] Building building tools
You are ready to build VLC and its contribs
Setting symbol environment
Setting contrib environment with minimum macOS version 10.11 and SDK /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
[build] Building contribs
Packages licensing... GPL version 3
Creating makefile...
Bootstrap completed.
Run "make" to start compilation.
....
make: Nothing to be done for `fetch'.
make: `.gettext' is up to date.
# Framework
cd breakpad/src/client/mac/ && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64 CLANG_CXX_LIBRARY=libc++
# Build Sparkle and change the #rpath
cd sparkle && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
make: *** [.sparkle] Error 64
make: *** [.breakpad] Error 64
make: Target `all' not remade because of errors.
# Framework
cd breakpad/src/client/mac/ && xcodebuild MACOSX_DEPLOYMENT_TARGET=10.11 -sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk WARNING_CFLAGS=-Werror=partial-availability OTHER_CFLAGS=-fno-stack-check -arch x86_64 CLANG_CXX_LIBRARY=libc++
xcodebuild: error: SDK "/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk" cannot be located.
make: *** [.breakpad] Error 64
cf: ../extras/package/macosx/build.sh -h
It says:
usage: extras/package/macosx/build.sh [options]
Build vlc in the current directory
OPTIONS:
-h Show some help
-q Be quiet
-j Force number of cores to be used
-r Rebuild everything (tools, contribs, vlc)
-c Recompile contribs from sources
-p Build packages for all artifacts
-i <n|u> Create an installable package (n: nightly, u: unsigned stripped release archive)
-k <sdk> Use the specified sdk (default: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk)
-a <arch> Use the specified arch (default: x86_64)
-C Use the specified VLC build dir
-b <url> Enable breakpad support and send crash reports to this URL
-d Disable debug mode (on by default)
Your build command should also include the location of your SDK using the -k option:
../extras/package/macosx/build.sh -c -k /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
The script uses xcrun --show-sdk-path to set the SDK otherwise. xcrun uses the environment variable $SDKROOT.
Note: You might want to install and use the versioned SDK, for example in your question the output shows that it is targeting minimum El Capitan, /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
The versioned SDKs are available in old Xcodes, and on github.
Setting up the "contrib environment" is all handled by the "single command".

How to build Qt5 as static libraries under Windows

To distribute a Qt appication to Windows users as a simple .exe file, one would need to link statically with a static version of Qt libraries. Assume we distribute our license under an open license so that static linking of Qt is allowed. So we just need static library binaries of Qt5Core, Qt5Gui, Qt5Widgets. How to get them?
The binary distribution of Qt5 comes with dynamic libraries only. It contains some .lib files as well - but beware, these are not the static libraries, but some auxiliary files. They can be distinguished from true static libraries by their size: true static libraries are much bigger (many MB in the case of Qt5 components). So we need to statically compile Qt5 ourselves. This turns out to be surprisingly difficult.
The official instructions (http://doc.qt.io/qt-5/windows-building.html) are almost useless: Way too short, they do not even convey an idea of the difficulty of the task. A precise, up-to-date, step-by-step guide how to compile Qt5 into static libraries is currently missing. We should have it here.
The short answer: Don't waste your time on this. Link dynamically, and let an installer distribute your application. This is the only mode that is seriously supported by Qt5 and by CMake. Working without their support and against their advise is close to hopeless. Setting up an installer is far easier (though no fun either - we currenly use black magic from https://hk.saowen.com/a/d1cf90fcfea6d511629fd5a6c8113808721a7f19656677e8a5fab370a8d35cd4).
The long (yet incomplete) answer, in case you want to outsmart me:
The following steps brought me deceptively close to a solution. I succeeded in building static libraries, but I failed to link my application: Upon getting hundreds of LNK2001 and LNK2019 errors caused by cryptic unresolved external symbols, I had to give up.
So here comes a step-by-step description of what worked for me in October 2018 on a Windows10 virtual desktop. For each installation step, a check is indicated. If a check fails then fix the problem before proceeding further.
To start, install some tools that are needed later on:
Perl, needed for zlib and openssl configuration:
Skip if "perl -v" works.
Get installer from https://www.activestate.com/activeperl
Run installer -> will install to C:\Perl64.
Check: Restart terminal and try "perl -v".
An editor that can handle Unix end-of-line. Notepad won't do. Install vim, emacs, or whatsoever.
chocolatey package manager, needed to install flex and bison:
Run admin shell (Circle Menu > search for "Command" > right-click on "Command Prompt" > run as Admin)
Copy download command from https://chocolatey.org/install#install-with-cmdexe
Paste command to admin shell, and watch installation
Check: in terminal, try command "choco"
flex and bison, needed by qtbase compilation:
It's not obvious to get the right version of flex. From gnuwin32.sourceforge.net I got an outdated flex that missed a command-line argument required during Qt compilation. Compiling flex from source introduces a tail of further dependences. The simplest solution I found uses the Chocolatey package manager.
In admin shell, run: "choco install winflexbison3". This creates a directory X that contains the binaries win_flex.exe and win_bison.exe and a supporting "data" folder. Find out the location of X. In my case, X=C:\ProgramData\chocolatey\lib\winflexbison3\tools
Check: cd X, and run "win_flex --version", "win_bison --version".
During Qt compilation, these tools will be needed under their standard names "flex" and "bison". Therefore we need symbolic links flex->win_flex, bison->win_bison.
mlink X\flex.exe X\win_flex.exe
mlink X\bison.exe X\win_bison.exe
note: mklink needs absolute paths to work reliably
note: the symlink must not go to another directory lest bison won't find the "data" folder
Add X to the %PATH%
Check: in any shell, try "flex --version" and "bison --version"
So far for the tools. Now we need two libraries that must be statically linked to Qt (magic learned from https://stackoverflow.com/a/41815812/1017348):
Build static zlib:
Download https://zlib.net/zlib1211.zip
Unpack to C:\Development\zlib-1.2.11
Edit the file win32\Makefile.msc with an editor that can handle Unix EOLs:
Find the line starting with CFLAGS
Replace -MD with -GL -MT -Zc:wchar_t-
Find the line starting with LDFLAGS
Replace -debug with -opt:icf -dynamicbase -nxcompat -ltcg /nodefaultlib:msvcrt
Build zlib using the following command (should take less than a minute):
nmake -f win32/Makefile.msc AS=ml64 LOC="-DASMV -DASMINF -DNDEBUG -I." OBJA="inffasx64.obj gvmat64.obj inffas8664.obj"
Check: as a result, the source directory must contain zlib.lib (856kB), inter alia.
Build static openssl library:
Download https://www.openssl.org/source/openssl-1.1.1.tar.gz
Unpack to C:\Development\openssl-1.1.1
Copy files from zlib: cd zlib-1.2.11; xcopy zconf.h ..\openssl-1.1.1\ ; same for zlib.h zlib.lib zlib.pdb
cd ..\openssl-1.1.1
perl Configure VC-WIN64A no-asm no-shared zlib no-zlib-dynamic threads --prefix=C:\opt\local_x64
note: I added "no-asm" to avoid installation of NASM (Netwide Assembler)
note: I changed prefix, since only admins can install to C:\Windows
Edits the file ''makefile'':
Find the line that starts with: CFLAG
Append: /Zc:wchar_t- /GL /Zi
Find the line that starts with: LDFLAGS
Replace /debug with /incremental:no /opt:icf /dynamicbase /nxcompat /ltcg /nodefaultlib:msvcrt
Find the line that starts with: CNF_EX_LIBS
Replace ZLIB1 with zlib.lib
Build: "nmake"
Check: directory must contain openssl.lib (size?)
Now we are ready to build qtbase from source, using the command-line version of the Visual Studio C++ compiler:
Download (update location for latest Qt): https://download.qt.io/archive/qt/5.11/5.11.2/submodules/qtbase-everywhere-src-5.11.2.zip
Unpacking takes ca 20'
Move the source directory to the Local Disk (C:\Development)
To work with Visual Studio, use a specially configured terminal. Use Taskbar>Circle>Search to launch "x64 Native Tools Command Prompt for VS 2017"
cd qtbase...
Check: configure --help
configure -platform win32-msvc2017 -opensource -confirm-license -release -static -openssl-linked no-dbus -no-libpng -no-libjpeg -nomake examples -nomake tests -prefix C:\opt\local_x64 -I C:\Development\openssl-1.1.1\include -L C:\Development\openssl-1.1.1 -D OPENSSL_LIBS=C:\Development\openssl-1.1.1\libssl.lib
while debugging "configure", it may be necessary to delete config.cache.
option -I does not work with relative paths
the label "win32" may look wrong if we want to use Qt in a 64bit application, but we are advised not to worry: building Qt under Windows: really with "-platform win32-msvc2017"?
I don't know how to get rid of Sql: https://bugreports.qt.io/browse/QTBUG-71253
libpng and libjpeg are needed by optional code. They are provided in src/3rdparty, which tends to provoke clashes with system provided library versions. Therefore, we build without PNG and JPG support.
nmake
Check: static libraries (big .lib and small .prl) land in directory lib/
54.7 MB Qt5Core.lib
23.4 MB Qt5Widgets.lib
18.2 MB Qt5Gui.lib
07.4 MB Qt5Network.lib
...
That's it, we have static Qt libraries. Only, as said above, this did not help me when I tried to link my application with these libraries.

MITK Build Error

I Build manually Qt 4.7.4 64bit and use cmake-gui in window7 make MITK source.
configure.exe -debug-and-release -qt-sql-sqlite -no-multimedia -no-audio-backend -no-phonon -no-phonon-backend -no-declarative -mp -nomake examples -nomake demos -nomake docs -opensource -platform win32-msvc2013
after make MITK, I build it use visual studio 2010 64bit
but there is some error like this
Error 91 error : could not find CMAKE_GENERATOR in Cache D:\MITK\MITK-superbuild-msvc2010_x64-03\CUSTOMBUILD
Error 89 error MSB6006: "cmd.exe" exited with code 1. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets 151
what can I do for solve this problem?
I had similar problem. Those two links were very helpful:
https://www.mail-archive.com/mitk-users#lists.sourceforge.net/msg06034.html
http://sourceforge.net/p/mitk/mailman/message/34233529/
Firstly I downloaded patch.exe from gnuwin32 site. Then I added path to it in system variables.
And using CMake I builded MITK from source file:
MITK-2015.05.0-src-win.zip
During all procedures I blocked my antivirus. Now it's working fine.

Multicore compilation with Qt 5.1 and jom on Windows 7 failed

I have installed Qt 5.1.1 with MinGW 4.8 and QtCreator through Qt Online installer.
I launched Qt creator and made new project (Qt application Desktop) with MainWindow class based on QMainWindow (default). It works fine and popped up a mainwindow after compilation.
However, when I used C:\Qt\Qt5.1.1\Tools\QtCreator\bin\jom.exe instead of C:\Qt\Qt5.1.1\Tools\mingw48_32\bin\mingw32-make.exe , I got some output like below.
jom 1.0.13 - empower your cores
C:\Qt\Qt5.1.1\Tools\QtCreator\bin\jom.exe -f Makefile.Release
g++ -c -pipe -fno-keep-inline-dllexport -O2 -frtti -Wall -Wextra -fexceptions -mthreads -DUNICODE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -I../foobar -I'C:/Qt/Qt5.1.1/5.1.1/mingw48_32/include' -I'C:/Qt/Qt5.1.1/5.1.1/mingw48_32/include/QtWidgets' -I'C:/Qt/Qt5.1.1/5.1.1/mingw48_32/include/QtGui' -I'C:/Qt/Qt5.1.1/5.1.1/mingw48_32/include/QtCore' -I'release' -I'.' -I'.' -I'C:/Qt/Qt5.1.1/5.1.1/mingw48_32/mkspecs/win32-g++' -o release/main.o ../foobar/main.cpp
In file included from ../foobar/main.cpp:1:0:
../foobar/mainwindow.h:4:23: fatal error: QMainWindow: No such file or directory
#include <QMainWindow>
^
compilation terminated.
jom: D:\work\build-foobar-Desktop_Qt_5_1_1_MinGW_32bit-Release\Makefile.Release [release\main.o] Error 1
jom: D:\work\build-foobar-Desktop_Qt_5_1_1_MinGW_32bit-Release\Makefile [release] Error 2
15:17:38: Process "C:\Qt\Qt5.1.1\Tools\QtCreator\bin\jom.exe" stopped with code 2
Error while building/deploying project foobar (kit: Desktop Qt 5.1.1 MinGW 32bit)
During step 'Make'
15:17:38: Elapsed time: 00:00.
My .pro is like this.
#-------------------------------------------------
#
# Project created by QtCreator 2013-09-08T15:16:13
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = foobar
TEMPLATE = app
SOURCES += main.cpp\ mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
I think the line in .pro greaterThan(QT_MAJOR_VERSION, 4): QT += widgets and in the output during compilation -I'C:/Qt/Qt5.1.1/5.1.1/mingw48_32/include/QtWidgets' looks fine, but failed.
How can I compile with Qt 5.1 and jom on Windows 7 (32 bit)?
Thanks in advance.
Jom is a replacement of nmake and not MinGW's make.
nmake is the Visual Studio command line tool used to compile makefiles. Unfortunately that tool is using only one core (Parallel builds are handled inside Visual Studio either directly or using MSBuild, I'm not really sure). That being said, Jörg Bornemann wrote a tool called jom that sort of adds the -j command to nmake. It will allow you to compile your code using the Visual C++ compiler across different threads.
MinGW on the other end contains (amongst other things) a port of the GNU GCC compiler for Windows. Being a port, not everything that is possible to do with GCC is possible with MinGW and I guess that -jN is one of these. However, MinGW do support the option -j that will spawn as many processes as it can (beware that if you use this option, you may not be able to use your computer whilst compiling).
In your case, you probably want to use MinGW as your Qt version is compiled with it. If you want to use Visual Studio, you will have to install it but also either:
recompile Qt (and all other library dependencies) or
download the binary corresponding to the Visual Studio version you just installed.
Using jom should just work with QtCreator once this is done.
In my case I fixed this error by overriding system environment PATH in project settings by adding only bin path to qt, mingw and qtcreator: "E:\Qt\4.8.1\bin;E:\qt\mingw-4.4.0\bin;E:\Qt\qtcreator-4.0.0\bin" and after Run qmake and Rebuild

Resources