QtWebEngine - procedure not found - c++

I have a simple C++ (non Qt Quick) application (that does not use .pro mechanism) built against the official Qt 5.4.2 x64 build (with openGL support).
As soon as I use the QWebEngineView object in my application, it fails to load with a message "Specified procedure could not be found".
With the help of gflags, it seems it fails to find the following demangled procedure:
public: __cdecl QOpenGLWidget::QOpenGLWidget(class QWidget * __ptr64,class QFlags<enum Qt::WindowType>) __ptr64
I am not sure to understand why this cannot be found, I have put for the sake of testing all the dlls in Qt_DIR\bin next to the application, and all the plug-ins.
The preprocessor list I use to build my app are as follow:
WIN32;_DEBUG;_WINDOWS;_USRDLL;WIN64;QT_WEBENGINEWIDGETS_LIB;QT_WEBENGINE_LIB;QT_QUICK_LIB;QT_PRINTSUPPORT_LIB;QT_WIDGETS_LIB;QT_GUI_LIB;QT_QML_LIB;QT_NETWORK_LIB;QT_UITOOLS_LIB;QT_CORE_LIB;WIN32PROJECT5_EXPORTS;PLUGIN_VENDOR_NAME="$(VendorName)";PLUGIN_VERSION="$(PluginVersion)";PLUGIN_NAME="$(PluginName)";%(PreprocessorDefinitions)
And the input libraries:
Qt5Cored.lib;Qt5Guid.lib;Qt5Widgetsd.lib;Qt5WebKitd.lib;Qt5WebKitWidgetsd.lib;Qt5WebEngineWidgetsd.lib;Qt5WebEngined.lib;Qt5OpenGLExtensionsd.lib;Qt5OpenGLd.lib;Qt5Networkd.lib;Qt5Xmld.lib;D:\NotBackedUp\Tools\Qt\5.4\msvc2013_64_opengl\lib\qtmaind.lib;shell32.lib;Qt5Quickd.lib;Qt5PrintSupportd.lib;Qt5Qmld.lib;Qt5UiToolsd.lib;glu32.lib;opengl32.lib;gdi32.lib;user32.lib;o2d.lib;%(AdditionalDependencies)
I wanted to try a simple example in Qt Creator 3.6.1 but it complains: Project ERROR: Unknown module(s) in QT: webenginewidgets
The browser.exe example runs fine (built with visual studio)
Do you have any idea of what is wrong?
PS: I am on windows 8.1.

For the procedure not found, my dll is a plug-in of a Qt application that is not built with opengl support. Only my dll is built with opengl support.
When initializing the plug-in, the application uses its own dlls rather the mine... and therefore fails to have any opengl support for the web engine.
For Qt Creator, it selected automatically a wrong kit. I had to create a new kit which maps to the correct Qt binaries (with opengl support): follow this: http://doc.qt.io/qtcreator/creator-configuring-projects.html.
Hope it will help someone

Related

wxWidgets failed to register window class on Windows when using wxMathPlot as DLL

I am writing a cross platform application in C++ that is creating some plots. For GUI I am using wxWidgets 3.1.3 and for plots wxMathPlot.
On linux it works great but on Windows I get the following error:
...\src\msw\window.cpp[3994]:assert "wclass" failed in wxWindow::MSWCreate(): failed to register window class?
I am using Visual Studio 2019. The error is present on both Debug and Release, but only when I am using wxMathPlot as DLL.
I've tried to recompile wxWidgets and to add propriety sheet from wxWidgets to wxMathPlot project but I get the same error.
It's not a requirement of the project to use wxMathPlot as DLL but I am curious on why this behavior happens.
It's not clear if you use wxWidgets as a DLL as well, but you really need to do it in order for it to work, i.e. both the mathplot DLL and your main application must define WXUSINGDLL when compiling and link with the DLL import libraries. Otherwise you'd end up with 2 copies of the same static library in the same process, which can create many problems.

Deploying a qt application on Linux

I have read and followed the procedure given on qt website. But I am unsuccessful in deploying my application (on ubuntu 15.10, qt 5.4). I followed many blogs and answers on stackoverflow in vain. (In particular, I tried this)
I downloaded the qt source and built it statically. But I am unable to deploy my application. My application uses "webkit". So I manually built the webkit and webkitwidgets. Then I configured my Qt creator to use the static build of qtversion for building my app. It throws an error
Unknown module(s) in QT: webkitwigets
But I rechecked that webkit and webkitwidgets have been built statically. So, where am I going wrong?
Alternatively, I tried the statifier application, but it always produces a corrupt executable that does not even run on the same system. (Ermine - commercial version of statifier is not an option for me)
How do I deploy this app on linux?

Qt deployment issue (MinGW inside)

I try to deploy a Qt app on a basic Windows 7 Pro SP1 machine.
My app works fine when I run it inside Qt Creator or on any machine with Qt insllated.
I have read a lot of posts and try many different things without success.
Things tried :
Windeploy Qt
Quick and dirty method of Qt Wiki
Add mingwm10.dll
Add libEGL.dll
Check loaded dll with dependency walker
Check loaded dll with Qt Creator debugger
My app crashes when I run it with these two error messages :
This application failed to start because it could not find or load the Qt platform plugin "windows".
This application has requested the runtime to terminate it in an unsual way. Please contact...
This is my current tree (obtained with windeployqt) :
*.exe
*.dll
platforms/qwindows.dll
imageformats/*.dll
iconengines/*.dll
With dependency walker, I have some red lines even if the app runs normally but nothing interesting.
Dev machine info :
Windows 7 Pro Sp1 64 Bits
Qt Creator 3.3.0
MinGW 4.9.1 32 Bits
Qt SDK 5.4.0
I'm probably doing something wrong but what ?!
The executable seems to search something in the Qt base directory because when I rename it the deployed app doesn't want to work anymore.
Need help please ;)
Ok, I found the solution...
I added this line at the very beginning of my main function :
QApplication::addLibraryPath("./");
After that, windeployqt does the job.
I hope it will help someone in the future.

Qt Application crashes whenever WebKit tries to load HTML

I'm using Qt 4.7.4 with C++ and I'm trying to embed a html document with some flash elements into a Qt application. To start out I added a QWebView widget to my main window and tried to load a html document stored on my harddrive, that caused an error so I looked up the Qt examples and attempted to run the youtube viewer example here: http://qt-project.org/wiki/Embed_YouTube_Video_in_QWebView
Both times I got the same issue when attempting to run the program:
"The procedure entry point ??1QSslSocket##UAE#XY could not be located
in the dynamic link library QtWebkit4.dll"
I used dependency walker and it states that QSslSocket is in QNetwork4.dll which is in my release folder (and it's the release version). Also my QTDIR environment variable points to the correct location and the location of the bin folder is in my path variable.
So I was wondering if anyone here could help me out. I'm also using visual studio 2005 (unfortunately using Qt 4.7.4 and vs 2005 are out of my control in this instance)
You would need to check the following things:
Your Qt installation is built with SSL support.
You have the SSL dll correctly recognized.
You have the version required to avoid symbol mismatches.

How to connect QT with VLC player

In my QT GUI application I need playback some video files. I tried the MediaPlayer component (qtmultimedia 5.0), but it cannot read the video containers (mp4/mkv) that I'm using, which VLC player runs without any problem. So I found an library called vlc-qt (http://projects.tano.si/vlc-qt) and downloaded the windows binaries (which seem to be compiled using MSVC 11.0), but it fails to link on QT Creator MinGW (it shows 16 lines of undefined reference), maybe because vlc-qt is compiled with a different compiler than the one used to build the QT app.
I can't find any working references or documentation on this topic, so does anybody know how can I make this?
More details:
Windows 8.1 x64
QT Creator 3.0.1 | QT 5.2.1
vlc-qt 0.9.0
C++
Thank you.
The library is compiled using MSVC so it can not be liked to your application with a MinGW compiler. You can get the code from Here and compile it with MinGW compiler. After that you can link it to your app.
You can download and install CMake from Here. Next open the file named "CMakeLists.txt" from the root of the VLC_Qt source code with Qt Creator. Click "Next" and then after selecting the desired Generator click "Run CMake". WHen everything completes click finish. Now you can build the entire VLC-Qt with Qt Creator.