dimitar-asenov/Envision

qtwebkitwidgets/qgraphicswebview:no such file or directory

Closed this issue · 7 comments

Vm900 commented

Tried compiling the ide on my work laptop and 95% towards the end of compilation i get
qtwebkitwidgets/qgraphicswebview:no such file or directory.I happen to have everything installed as per the instructions.So far i've added the location of the file in my profile to no avail.Any suggestions?thanks

It looks like you don't have the QtWebKit module. The QtWebKit module is no longer part of the official Qt distribution. It needs to be installed separately and might even be completely unavailable in the future (which will need a redesign in Envision, at least we use it non-critical parts). Two things come to mind:

  1. Double check that QtWebKit is installed. An example for Ubuntu is in the compilation instructions: sudo apt-get install libqt5webkit5 libqt5webkit5-dev. There should be no need to do any manual path specifications or add things to your profile. Hopefully, it works similarly with the package managers of other distros. If you're installing Qt without a package manger, things will be more tricky. For example, as far as I can see the installer on the Qt website no longer includes QtWebKit. Your can try to manually compile it or find it some other way, but I'm not sure how that might be.

  2. Check your Qt version. I'm currently using Qt 5.11.1 from the repositories of Ubuntu 18.10, and have no problem compiling. Perhaps your version of Qt (especially if newer) doesn't have the QtWebKit module. See how the versions and the installation method differ between your home and work computers.

Let me know how this goes.

Vm900 commented

Hi,
I downgraded from Qt 5.11.2 to 5.11.0 but the problem persists.

qtwebkitwidgetsnosuchfile2
QtCreator error
qtwebkitwidgetsnosuchfile

Ok, so the files are definitely there, but the build system can't find them for some reason. It's also a bit odd, that only the Alloy project seems to fail, as the QtWebKit module is used by other projects too. Here is a few more things to try:

  • Perhaps something went wrong with generating the Make file from CMake. Try regenerating it. From the Qt Creator menu, run Build > Clear CMake Configuration and then Rebuild All.
  • I see that in my Qt Creator settings, there are some extra definitions for the Qt modules. In the build settings for the particular project and kit, in the CMake settings there is a table of Key/Value pairs that defines some CMake variables. I have a variable here called Qt5WebKitWidgets_DIR with a value of /usr/lib/x86_64-linux-gnu/cmake/Qt5WebKitWidgets (there's also quite a few more similar variables for the other Qt module directories). I've never had to set this before, but perhaps it's missing in newer version of QtCreator. My QtCreator version is 4.5.0, but I've continuously updated from previous versions and it's possible that if I install everything from scratch, the Qt5WebKitWidgets module will be missing.
  • It might be useful to see exactly what command is executed to build the cpp file that fails. Add this line set(CMAKE_VERBOSE_MAKEFILE on) right after the cmake_minimum_required(VERSION 3.7.2) in the top-level CMakeLists.txt. Now if you recompile everything you will see the full compiler invocation command for every line. You should be able to copy and paste the compiler invocation command in a terminal and execute it there with slight modifications in order to see what might be wrong. E.g. adding the -v flag to g++ will output a lot more information about where it tries to search for include files.

I hope this helps, let me know what you find.

Vm900 commented

Hi,
These are my variables that were automatically generated-
cmakeconfigurations
Now after running the compiler from the terminal here is what i got
cmakecmderror

Hmm, something looks fishy here. All of my variables point to the same system directory:
image
whereas some of your paths are in /home/vmur/ and others in /usr/lib. I bet this is a symptom of the issue.

You can see the problem also in the include list. For comparison, here is mine:

 /store/envision/build-envision-Clang-Default/Alloy
 /store/envision/envision/Alloy
 /store/envision/envision/Alloy/..
 /usr/include/x86_64-linux-gnu/qt5
 /usr/include/x86_64-linux-gnu/qt5/QtCore
 /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++
 /usr/include/x86_64-linux-gnu/qt5/QtWidgets
 /usr/include/x86_64-linux-gnu/qt5/QtGui
 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8
 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/x86_64-linux-gnu/c++/8
 /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/backward
 /usr/include/clang/6.0.1/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include

In my case, I have Qt installed from the native repositories of Ubuntu and all corresponding include files are under /usr/include/x86_64-linux-gnu/qt5 which is the fourth entry in the list above. In your case, it seems that you have multiple versions of Qt installed. One is in /home/vmur/Qt5.11.0/ with include files in /home/vmur/Qt5.11.0/gcc_64/include and another is in the standard system location with include files in /usr/include/x86_64-linux-gnu/qt5. However, only the first path appears in the include directories list of your Gcc command, and that's why the files in /usr/include/x86_64-linux-gnu/qt5 cannot be found.

This is not really that bad, in the sense that you really don't want to mix up the includes from two different Qt versions.

The core issue is that the Qt version in your home directory most certainly doesn't have the QtWebKit module. You can verify this by looking for it in /home/vmur/Qt5.11.0/gcc_64/include.

If you go to Tools > Options > Build & Run > Qt Versions you should see two versions and currently the one that's in your home directory is selected, but that one doesn't have the necessary module. If you don't see two versions you can always the second one.

You have three options:

  • (easiest/recommended) Switch the Envision build configuration to the Qt version from the distro's default packages. This seems to already have the QtWebKit Module, based on the screenshot from your second comment. Make sure that all CMake variables have automatically switched to the files in /usr/include/.... Note that you can keep as many different versions of Qt as you want on your system and configure each project with a different one.
  • Continue using the Qt version that's in your home directory, but make sure it includes the QtWebKit module. I don't actually know how to achieve this.
  • Compile the latest Qt sources from scratch and use those. These will include QtWebKit as an optional module, but needless to say that's a ton of hassle and you're looking at several hours of compile time on a laptop.
Vm900 commented

Right i got it working now.Pointed everything to the system files following your setup and it worked.Thanks for your patience.I'm coming from a windows environment,cushioned behind visual studio.Learned a lot this week.Good day

Great that you got it working, and I'm glad that you also found this to be a learning experience :)

Let me know if you encounter further difficulties.