Unsolved Build exe-file of Qt4-Project
-
@koahnig said in Build exe-file of Qt4-Project:
You have to set the path environment variable to include the folder where your compiler is.
set PATH=C:\Users\blablabla\AppData\Local\Programs\Python\Python36-32\;c:\MinGW64\mingw-w64\x86_64-7.2.0-posix-seh-rt_v5-rev1\mingw64\bin;%path%
I needed to add the path of MinGW and created a bat-file for this. When you start the bat in a command prompt it will be only available until you close the prompt. Checkout where your visual studio with nmake is installed. IIRC it should be also a bin folder. You need to replace the MinGW part. Above I have added also an entry to python.
I added the path of MinGW to the path environment. Now it seems to work. But when I type this:
configure -static -release -no-exceptions
I get an error: Qmake failed
-
My compilations of Qt 4 are years back. Therefore my memory has significantly faded away and I do not remember what different other tools I had installed. The only I remember is that the configure stuff had be done and then the make.
For my fresh Qt 5 installation before Christmas I had to install versions of "perl" and "phyton" (both accessible through the path environment variable). Certainly I had to install the desired compiler which was MinGW 64 bit in my case. The path to python and MinGW are set through the statement already given in my last post.
I had picked the desired version of Qt from the archives. For windows you have to pick a .zip version tar-stuff can be used for linux only. Unzipped it to a folder and started from a command prompt in that folder.
Here is the configure command, which worked perfectly for me. However, I was compiling Qt 5.9.3 as you see.
configure -prefix c:\Qt64\Qt5.9.3 -confirm-license -debug-and-release -opensource -platform win32-g++ -opengl desktop -nomake examples -nomake tests
Those parameters are for Qt 5. You need to check the parameters with "configure --help" for your actual version. Within those 9 major release things might have checked. The configure parameters were also explained on web page Qt 4, but I cannot find it right away.
-
Hi,
qmake failed
doesn't say much, please provide the build log or at least the error messages that comes before this one. -
Hi,
I tried now nmake of my Visual Studio 2017 installation. Therefore I run this command in the VS command prompt:
configure -static -release -no-exceptions
This works. It shows at the end: "Qt is now configured for building. Just run nmake."
But when I runnmake sub-src
after 20 minutes of compiling it shows an error:
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\cl.EXE"": Rückgabe-Code "0x2"
Stop.
NMAKE : fatal error U1077: ""C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x86\nmake.exe"": Rückgabe-Code "0x2"
Stop.
NMAKE : fatal error U1077: "cd": Rückgabe-Code "0x2"
Stop. -
These are the finales lines that just state the compilation failed. Above these are those that are containing what is currently failing to build.
-
@SGaist said in Build exe-file of Qt4-Project:
These are the finales lines that just state the compilation failed. Above these are those that are containing what is currently failing to build.
There is something like this:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdint(46): error C2039: "uintmax_t": Ist kein Element von "`global namespace'"
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\include\cstdint(46): error C2873: "uintmax_t": Das Symbol kann nicht in einer using-Deklaration verwendet werden -
Ok... I didn't realised that you where using VS2017. The latest version of Visual Studio used to build Qt 4.8 was 2015. You will have to copy the 2015 mkspec and tweak it in order to build it.
MinGW might be a quicker choice depending on your needs.
-
@SGaist said in Build exe-file of Qt4-Project:
Ok... I didn't realised that you where using VS2017. The latest version of Visual Studio used to build Qt 4.8 was 2015. You will have to copy the 2015 mkspec and tweak it in order to build it.
MinGW might be a quicker choice depending on your needs.
I will try to build it with Visual Studio 2015 tomorrow. Thanks for your hint.
-
I tried now to build it with Visual Studio 2015 but the same errors ocurr.
-
During which part of the build ?
-
@SGaist said in Build exe-file of Qt4-Project:
During which part of the build ?
during the compilation with nmake
-
So configure is successful ?
-
-
By the way, which version of 4.8 is it ?
-
-
Did you check which mkspec gets selected when configuring Qt ?
-
@SGaist said in Build exe-file of Qt4-Project:
Did you check which mkpec gets selected when configuring Qt ?
no
-
I also tried it that way:
https://wiki.qt.io/How_to_build_a_static_Qt_version_for_Windows_with_gcc
But at the step where to modify the file qtenv.bat I don't find such a file in my Qt-folder.
-
This one looks more recent.
-
@SGaist said in Build exe-file of Qt4-Project:
This one looks more recent.
This one also doesn't work.
I tried now the tool windeployqt which comes with Qt5, but it seems to work only with Qt5-binaries. It would be enough if I could pack the exe file of my project with the necessary dlls in one folder so it runs on every Windows computer.