building a monolithic (standalone) program
-
I'm trying the Powershell script again. I found a couple items that needed changing (they could be modified through parameters, but I found it easier to simply edit the script). Now when I run, I get this error:
ERROR: Invalid value given for boolean command line option 'sql-sqlite'. mingw32-make: *** No targets specified and no makefile found. Stop. mingw32-make: *** No rule to make target 'install'. Out-File : Could not find a part of the path 'C:\Qt\Static\5.9.1\mkspecs\win32-g++\qmake.conf'. At C:\Users\MZimmers\windows-build-qt-static.ps1:179 char:6 + "@ | Out-File -Append $File -Encoding Ascii + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : OpenError: (:) [Out-File], DirectoryNotFoundException + FullyQualifiedErrorId : FileOpenFailure,Microsoft.PowerShell.Commands.OutFileCommand
I don't know whether the sql error is related to the real problem or not, but $File is defined as "$QtDir\mkspecs\win32-g++\qmake.conf" and C:\Qt\Static\5.9.1 is empty. Anyone have an idea what's going on here?
-
@mzimmers said in building a monolithic (standalone) program:
C:\Qt\Static\5.9.1 is empty
why is it empty? What is in C:\Qt\Static ?
Before you specified that Qt source code is in C:\QtStatic, why do you use C:\Qt\Static now? -
The PS script installs into Qt/Static, or at least it's supposed to. I chose QtStatic before I realized the script used Qt/Static. According to my understanding of the web page, the script is supposed to download and populate that directory. I don't know why it's empty.
I have source in C:\QtStatic\5.9.1\Src from downloading it myself (not through the script). I suppose I could move it to Qt\Static\5.9.1\Src and see what the script would do. I was just under the impression the script would take care of the download for me, so I'm not sure what to do now.
-
@mzimmers said in building a monolithic (standalone) program:
script doesn't seem to be working for me, and I'd really like to get this done.
I don't know much about newer windows-es but usually it's just enough to open a command prompt (ming32 command prompt or MSVS command prompt), go to the Qt dir, call configure with the appropriate arguments (which would include
-static
in your case) wait a bit and then domingw32-make
/nmake
to build. Although providing the dependencies for windows is pretty finicky in my experience. -
OK I copied the configure command from the script and ran it manually. It worked once I removed the "-qt-sql-sqlite" switch.
Now I'm ready to run make. If I run it from C:\Qt\Static\src\qt-everywhere-opensource-src-5.9.1, though, that's where it will install it. I want it in Qt\Static. Is there a switch I can use on the make command to tell it to put Qt in Qt\Static? (I know this isn't a Qt question, but it does pertain to building/installing Qt.)
Thanks...
-
OK, I did the configure, make and install. Seemed to work fine.
I tried adding the new version of Qt in the build/run settings in Creator, but I get a warning "no qmlscene installed." A bit of googling reveals that this can be solved in the Linux world by installing qtdeclarative5-dev. Unfortunately, I can find no such analog for Windows.
I also have a general message "Running Windows Runtime device detection. No winrtrunner.exe found." True enough, there's no such executable in my bin directory. Should I care about this?
-
@mzimmers said in building a monolithic (standalone) program:
No winrtrunner.exe found
Mine also says that. If you are making a desktop app it should have no ill effects.
-
OK, I think I got this working. To recap, the advice on this page is very good. There are a few tweaks to the PowerShell that are needed for smooth sailing, though:
- the hard-coded default for the $QtSrcUrl variable is so old that it's not even on the download page anymore. Either pass it a different value using the "-QtSrcUrl" switch on the command line, or just edit it in the script.
- IMPORTANT use the zip file, not the tarball, when downloading the source. The script assumes a .zip file and forms some variable names based on the filename. If you use the tarball, it will extract successfully, but the script will fail downstream.
- the line:
$GccList = @(Get-ChildItem -Path C:\Qt\*\Tools\mingw*\bin\gcc.exe | ForEach-Object FullName | Sort-Object)
doesn't work, at least not on Windows 10. I had to remove the "\*" from the path.
-
in the invocation of configure.bat, I had to remove the "-qt-sql-sqlite" switch
-
also in the invocation of configure.bat, you might want to modify the "-prefix $QtDir " to point somewhere else, unless you want your static libraries under the src directory.
Thanks again to everyone who helped with this.