I do not understand how to install QtWebEngineWidget
-
Hi, I am a novice, and am trying to install QtWebEngineWidget to compile an open source project, and so far it has failed miserably.
Also, "I am a novice" is code for "I need more hand-holding that the official documentation is doing. Please do not assume I know what is meant by 'Set up \Microsoft Visual Studio 2017, where <arch> is \c amd64, \c x86, etc.' "
Anyway, the context is that I'm trying to change a tiny bit of code in an open source project I want to get involved in. So my first step is to get the project to compile once before making change.
I got the whole project from GitHub in zip, extracted etc. I also know the project is done in "Qt 5".
Anyway, I have downloaded and installed from the Qt downloader (MaintenanceTool.exe) :
In the "Developer and Designer Tools" section :
- Qt Creator IDE 4.8.1 (community)
- Qt Creator 4.8.1 CDB Debugger Support
- MinGW 7.3.0 64-bit
- Qt Installer Framework 3.0
In the Qt 5.12.1 section :
- MinGw 7.3.0 64-bit
- Sources
- Qt Charts
- Qt Data Visualization
- Qt Purchasing
- Qt Virtual Keyboard
- Qt WebEngine
- Qt Network Authorization
- Qt WebGL Streaming Plugin
- Qt Script (Deprecated)
- Qt Debug Information Files
I also installed independently from the Qt downloader, those :
- ActivePerl-5.26.3.2603-MSWin32-x64-a95bce075
- Windows 10 SDK
- gperf-3.0.1
- python-2.7.15
- flex-2.5.4a-1
- bison-2.4.1
- MinGW 32 bit (yes, that's 3 MinGW installs)
- Microsoft Visual Studio Community 2017 with the "Desktop Development in C++" bundle. (the name is a free translation from French)
From Visual Studio, I installed those : (all names are freely translated from French) - Just-in-time debugger
- VC++ 2017 version 15.9 v14.16 latest v141 tools
- Profiling tools C++
- SDK Windows 10 (10.0.17763.0)
- Visual C++ tools for CMake
- ATL Visual C++ for x86 and x64
- Test adapter for Boost.Test
- Test adapter for Google Test
And that's it for the stuff I installed to try to compile this project.
The open source project had a *.pro file recognized by Qt Creator. However, when I try to build, I get this message :
:-1: error: Unknown module(s) in QT: webenginewidgets
From this error message, I conclude I need to install QtWebEngineWidget.
As far as build settings go for this project, it has a kit that was auto-detected and is named "Desktop Qt 5.12.1 MinGW 64-bit". The icon is a grey computer monitor, without any warning or error icon attached. (there were some before I downloaded more stuff)
So from what I gathered in my googling, I need to actually compile Qt from the source to enable Qt Creator to use QtWebEngineWidget. However, I have no confidence that this is an accurate conclusion, hence my first question :
1. Do I really need to compile Qt from the source to use QtWebEngineWidget ?
Anyway, I'll assume I do to explain the rest of the problem.
So I got to this page : http://doc.qt.io/qt-5/qtwebengine-platform-notes.html
So something that may be damning me is that I didn't download and install the ICU and ANGLE libraries. My reasons are :
- The page says they're used to "run" Qt, not to build or compile.
- I can already run the .exe version of the open source project
- None of them have an obvious download link and it confuses me.
- I am afraid that downloading and installing more irrelevant stuff is going to break something somewhere and worsen my problems.
Anyway back to the aforementioned web page.
I skipped Step 1 because I'm on the community license.
I assume Step 2 was done by the Qt Downloader because I have a Src folder in my Qt\5.12.1\ directory full of .cpp and .h files and other stuff.The real problems are on step 3 and 4.
Step 3 is to make a .cmd file to do some hocus pocus with Visual Studio. I just recently learned at school batch and command files in an off-hand manner. (they just told us to write one and gave us one (1) example.) Anyway, the webpage gives this to put in the command file :
REM Set up \Microsoft Visual Studio 2017, where <arch> is \c amd64, \c x86, etc. CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" <arch> SET _ROOT=C:\qt\qt-5 SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH% REM Uncomment the below line when using a git checkout of the source repository REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH% SET _ROOT=
I managed to understand that this isn't meant to be plug-and-play, so here's the version I'm using :
REM Set up \Microsoft Visual Studio 2017, where <arch> is \c amd64, \c x86, etc. CALL "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64 SET _ROOT=C:\Qt\5.12.1\Src SET PATH=%_ROOT%\qtbase\bin;%_ROOT%\gnuwin32\bin;%PATH% REM Uncomment the below line when using a git checkout of the source repository REM SET PATH=%_ROOT%\qtrepotools\bin;%PATH% SET _ROOT=
My file is also called qt5vars.cmd and is in C:\Qt.
Anyway, I double-click, see the command prompt pop up with some fancy VISUAL STUDIO header, and then disappear after a few seconds with no goodbye message.
I then open a command prompt, navigate to C:\Qt\5.12.1\Src\qtbase, and enter the following command :
configure -debug -nomake examples -nomake tests -opensource
Just to be perfectly clear, this is the full line of code :
C:\Qt\5.12.1\Src\qtbase> configure -debug -nomake examples -nomake tests -opensource
Being told what the full line of code, with the full path, is supposed to look like would be helpful.
Anyway, I launch this, and then I get a smithereens of errors like this :
C:/Qt/5.12.1/Src/qtbase/qmake/generators/win32/msvc_nmake.cpp:448: undefined reference to `ProKey::ProKey(char const*)' C:/Qt/5.12.1/Src/qtbase/qmake/generators/win32/msvc_nmake.cpp:448: undefined reference to `ProString::ProString(QString const&)' (...) C:/Qt/5.12.1/Src/qtbase/qmake/property.cpp:121: undefined reference to `__ZNK9QSettings5valueERK7QStringRK8QVariant'
I also tried to use that command in just Src, and I got the same smithereens :
C:\Qt\5.12.1\Src> configure -debug -nomake examples -nomake tests -opensource
And I also tried this with essentially the same results :
C:\Qt\5.12.1\Src\qtbase> configure -debug -nomake examples -nomake tests -opensource mingw32-make install
("essentially" is code for "I got an enormous amount of similar errors but didn't verify if they were exactly the same".)
And that's where I'm stuck.
Oh! I forgot!
This is the full content of my PATH environment variable :
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps C:\intelFPGA_lite\17.0\modelsim_ase\win32aloem C:\Qt\Tools\mingw730_64\bin C:\Qt\5.12.1\Src\qtbase\bin C:\Qt\5.12.1\Src\gnuwin32\bin C:\Perl64\bin C:\Python27
Also, I am on Windows 10 Professional 64 bits.
Anyway, the only next steps of resolution I see are :
- Somehow download the ICU and ANGLE.
- Download all the packages from the Qt 5.12.1 section of the Qt downloader.
- Download all the stuff from the Visual Studio installer.
The problems with those 3 solutions are as follow :
- I have no idea if I'd be downloading the right ICU library
- The only way to "download" the ANGLE library seems to be to build it locally from source, and that would be the 3rd software in the chain of stuff I need to build from source (open source project -> Qt Creator -> ANGLE) and I'm starting to believe there's always going to be one more thing I could build from source in a never-ending chain of softwares that I don't even know if I really need them.
- All those other downloads are dozens of gigabytes. While not impossible for me to download it all, it does pose significant logistical challenges as I do not currently have a mean to throttle the downloads and they'll hog all the bandwidth in the household and effectively cut off our internet for the (long) duration of the downloads. (I found a software once to throttle downloads, but I only took the free trail and now it's expired)
Another solution is to contact the maintainers of the open source project. However, since they didn't include any kind of guide on how to compile except "built with Qt 5", I do not feel like they'd be open to do the hand-holding I need to compile the project. I'd also rather not risk to get negative social capital with them because I'd like them to take my tiny modification seriously and include it in the main branch. Also, even if I contacted them, I wouldn't know what precise questions to ask. Also, the creator is affiliated with an institution, so it may not even have been them who installed their Qt 5. Contacting them, however, is a serious candidate for the next step if I don't get the help I need on this forum.
Also, I have been reading the guides in diagonals, and that's probably part of the problem, but I do not know which guide is relevant and if I had been reading everything thoroughly, I might be banging my head trying to build the GNU GCC compiler from source thinking that's what I need. (because my first try to compile this was with CodeBlocks and gcc) (no, I did not know GNU GCC wasn't meant for Windows until this week)
Anyway, to recap, here are my questions :
1. Do I really need to compile Qt from the source to use QtWebEngineWidget ?
2. Is it reasonable to assume I need QtWebEngineWidget to compile this open source project?
3. Do I need to download and install ICU and ANGLE to compile Qt ?
3b. If so, what do I download? What link exactly do I need to click on?
4. Besides ICU and ANGLE, are there steps I missed?
5. Is my version of the command file sufficient for my purpose?
6. Anything else I am doing wrong?
7. Am I trying to do a "Static build" ?If your proposed solution is to download more stuff, please tell me if those additional downloads are absolutely needed, probably needed, or maybe needed.
Also, if you want to suggest linking to git in the command prompt, please carefully weight your suggestion before sending it. I am currently overwhelmed by all the new and confusing things I need to wade through, and have so far discarded doing git stuff as a deliberate strategy to reduce the amount of novelty and opportunities to mess up. I know I'll have to get to git sooner or later, but currently, my priority is to get the open source project to compile as-is.
Thank you for your time.
-
Hi and welcome to devnet,
Short answers:
- No need to build Qt, only use the correct version
- Install the C++ component of Visual Studio 2017 or the Visual Studio 2017 C++ build tools. The later being more lightweight than the former.
Why Visual Studio 2017 ? Because QtWebEngine relies on Chromium and in this case it's Chromium that dictates the choice of platform the module can be built for and used with.
What else ? Just install the Visual Studio 2017 version of Qt and as you already saw, you can select the QtWebEngine Module in the installer. And you should have everything you need to get started.
-
It still isn't working.
You said :
- Install the C++ component of Visual Studio 2017 or the Visual Studio 2017 C++ build tools. The later being more lightweight than the former.
Is this the component called :
VC++ 2017 version 15.9 v14.16 latest v141 tools
?
If not, can you tell me the exact name of the component, or what the name is supposed to look like for different versions? Because in the Visual Studio Installer, in the "Individual components" section, I didn't find anything name "C++ component of Visual Studio 2017" or "Visual Studio 2017 C++ build tools". Is the problem that I don't have the correct version of the "VC++ 2017 (...)" component?
Also, I downloaded Qt Visual Studio Tools from there : https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools-19123
Was this what you meant by "Just install the Visual Studio 2017 version of Qt" ?
Also, from the Qt Downloader, I got :
MSVC 2017 64-bit
Anyway, after all this, I got Visual Studio to recognize the open source project as a Qt project and started building. However, it then gave me those errors and warnings :
Warning Cannot find Visual Studio installation directory, VCINSTALLDIR is not set. Warning Cannot find Visual Studio installation directory, VCINSTALLDIR is not set. Warning QFile::remove: Empty or null file name Error MSB3073 The command "mkdir ".\Installer" & mkdir ".\Installer\packages" & /*(a big list of commands containing the name of the project that I prefer to keep anonymous) */ C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppCommon.targets(138,5): error MSB3073: :VCEnd" exited with code 1.
I then tried to create a new environment variable named VCINSTALLDIR with the following value :
C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC
I rebuilt the project ("Solution" in Visual Studio) and got the same errors.
I then tried to change the VCINSTALLDIR environment variable to :
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC"
And got the same results.
Is the environment variable superfluous, or did I just point it to the wrong place ?
Is the core problem that I need a specific version of Qt and other stuff to compile this specific project? Have we done enough to conclude that the problem is that I don't have the good versions?Thank you for your time.
-
@Vistouf said in I do not understand how to install QtWebEngineWidget:
Also, I downloaded Qt Visual Studio Tools from there : https://marketplace.visualstudio.com/items?itemName=TheQtCompany.QtVisualStudioTools-19123
Was this what you meant by "Just install the Visual Studio 2017 version of Qt" ?No, I literally meant: install the Qt version for Visual Studio 2017 that you can select in the Qt installer.
You should continue with Qt Creator, so you avoid the environment setup troubles for now.
-
@SGaist It worked!! 😄😄😄😄 Thanks!!!
So for anyone else who stumbled here, the trick was to get this package from the Qt installer :
MSVC 2017 64-bit
And then go in Qt Creator, and use the aforementioned package as a "kit" to compile the project.