twain-samples
twain-samples copied to clipboard
This application failed to start because it could not find or load the Qt platform plugin "windows" > in ""
I installed the binaries for the Data Sources in 32 bit and 64 bit. The installation went fine. When I use the Twain App then I can see the data sources; I tested the Twain App on 32 bit and 64 bit architecture. I can also connect to the data sources on both architectures.
However, when I want to perform a scan then I run into an unhandled exception and the following output is displayed (again on both architectures):
This application failed to start because it could not find or load the Qt platform plugin "windows" in "".
Reinstalling the application may fix this problem.
Unfortunately I have no experience with Qt and don't know what the error message means exactly in this case. My guess is that I have to install Qt or part of Qt and set it up in order to make this work.
It would be great if this can be addressed; e.g. explaining in the README file what to install and how to set up so that the virtual Data Sources can perform a scan.
I figured a solution that worked for me on 64 bit architecture, although I feel it is not the best practice to do so.
I installed Qt (the version mentioned in the README, which is 64 bit). In my case I went to the installed Qt directory and looked for the files (qwindows.dll (release) and qwindowsd.dll (debug)) because a search in the internet hinted that the error message means this file cannot be found.
In my case they were located under C:\Qt\5.9.9\msvc2017_64\plugins\platforms and to make it work I copied the folder platforms to the directory of the executable (of the Twain App for example).
I could perform a scan.
I do not have Qt 32bit though, but my feeling is that a similar approach would work.
I still do not really understand the subject. I can use a Twain App command line and I can use a Twain App Qt as far as I could see.
I wonder why I would need Qt in order to run a scan from the command line. This was not the case in a previous version of the command line Twain App as far as I remember.
I had this issue for a long time, this is how I managed to fix it:
- Install Qt 5.9.9 with the msvc2017_64 component
- Assign the Environment Variable QTDIR=C:\Qt\Qt5.9.9\5.9.9\msvc2017_64
- Assign the Environment Variable QT_QPA_PLATFORM_PLUGIN_PATH=%QTDIR%\plugins\platforms\
This allows the driver to be invoked from a program that doesn't have the Qt dlls (in my case, a console program)
I have found simpler solution so here it is:
- Install data source sample first
- Install twain app sample also
- Check if you can scan via app sample
- Create QT_QPA_PLATFORM_PLUGIN_PATH environment variable pointing at app sample dir with dll.
For example in my case the only thing I did was to set: QT_QPA_PLATFORM_PLUGIN_PATH = C:\Program Files (x86)\TWAIN Working Group\TWAIN 2.4.1 App Sample (32-bit)\win32\platforms
This folder should contain the following dll: qwindows.dll