No such plugin: 'peakcan'
-
Hi!
I'm writing a program to flash firmware on a power module via CAN with peakcan.
It works fine when I start it from Qt Creator
10:51:09: Starting C:/Git/AB_Flasher/10_Dev/flasher/build-flasher_qt-Desktop_Qt_6_4_0_MinGW_64_bit-Release/release/flasher_qt.exe... qt.canbus.plugins.peakcan: Using PCAN-API version: 4.6.1.728
But if I make a standalone app with windeployqt, it is unable to find the plugins
10:53:29: Starting C:/Git/AB_Flasher/10_Dev/flasher/build-flasher_qt-Desktop_Qt_6_4_0_MinGW_64_bit-Release/release/flasher_qt.exe... "No such plugin: 'peakcan'"
I'm using the following script to make the standalone application:
set PATH=C:\Qt\6.4.0\mingw_64\bin;C:\Qt\Tools\mingw1120_64\bin;%PATH% cd /D C:\Qt\6.4.0\mingw_64 .\bin\windeployqt.exe --plugindir $(TargetDir)\plugins C:\Git\AB_Flasher\10_Dev\flasher\build-flasher_qt-Desktop_Qt_6_4_0_MinGW_64_bit-Release\release .\bin\windeployqt.exe --libdir $(TargetDir)\lib C:\Git\AB_Flasher\10_Dev\flasher\build-flasher_qt-Desktop_Qt_6_4_0_MinGW_64_bit-Release\release
This adds .dll's and subdirectories as expected, including a canbus subdirectory, containing
-a---- 23/09/2022 05:42 82880 qtpassthrucanbus.dll -a---- 23/09/2022 05:42 64448 qtpeakcanbus.dll -a---- 23/09/2022 05:42 56256 qtsysteccanbus.dll -a---- 23/09/2022 05:42 56768 qttinycanbus.dll -a---- 23/09/2022 05:42 60352 qtvectorcanbus.dll -a---- 23/09/2022 05:42 63424 qtvirtualcanbus.dll
Every time the file Qt6Core.dll is present in the release directory the program fails to find the plugins. If Qt6Core.dll is removed, the plugins are found. But then I can start my application only through QT creator
Qt version and make environments I am using can be deduced from the name of my build directory, If you need more information please ask
I got lost in the Qt documentation regarding plugins because they are much too advanced and abstract for me, lacking any concrete example pertaining PeakCAN
Some help would be highly appreciated
-
Hi!
I'm writing a program to flash firmware on a power module via CAN with peakcan.
It works fine when I start it from Qt Creator
10:51:09: Starting C:/Git/AB_Flasher/10_Dev/flasher/build-flasher_qt-Desktop_Qt_6_4_0_MinGW_64_bit-Release/release/flasher_qt.exe... qt.canbus.plugins.peakcan: Using PCAN-API version: 4.6.1.728
But if I make a standalone app with windeployqt, it is unable to find the plugins
10:53:29: Starting C:/Git/AB_Flasher/10_Dev/flasher/build-flasher_qt-Desktop_Qt_6_4_0_MinGW_64_bit-Release/release/flasher_qt.exe... "No such plugin: 'peakcan'"
I'm using the following script to make the standalone application:
set PATH=C:\Qt\6.4.0\mingw_64\bin;C:\Qt\Tools\mingw1120_64\bin;%PATH% cd /D C:\Qt\6.4.0\mingw_64 .\bin\windeployqt.exe --plugindir $(TargetDir)\plugins C:\Git\AB_Flasher\10_Dev\flasher\build-flasher_qt-Desktop_Qt_6_4_0_MinGW_64_bit-Release\release .\bin\windeployqt.exe --libdir $(TargetDir)\lib C:\Git\AB_Flasher\10_Dev\flasher\build-flasher_qt-Desktop_Qt_6_4_0_MinGW_64_bit-Release\release
This adds .dll's and subdirectories as expected, including a canbus subdirectory, containing
-a---- 23/09/2022 05:42 82880 qtpassthrucanbus.dll -a---- 23/09/2022 05:42 64448 qtpeakcanbus.dll -a---- 23/09/2022 05:42 56256 qtsysteccanbus.dll -a---- 23/09/2022 05:42 56768 qttinycanbus.dll -a---- 23/09/2022 05:42 60352 qtvectorcanbus.dll -a---- 23/09/2022 05:42 63424 qtvirtualcanbus.dll
Every time the file Qt6Core.dll is present in the release directory the program fails to find the plugins. If Qt6Core.dll is removed, the plugins are found. But then I can start my application only through QT creator
Qt version and make environments I am using can be deduced from the name of my build directory, If you need more information please ask
I got lost in the Qt documentation regarding plugins because they are much too advanced and abstract for me, lacking any concrete example pertaining PeakCAN
Some help would be highly appreciated
@rzucca said in No such plugin: 'peakcan':
subdirectories as expected
What is inside plugins subfolder in deployed application?
-
Some explanations regarding the solution would be also highly appreciated
Surely I'm overseeing something and/or making some mistake. I'd like to find out what.
And above all, how to solve it
@rzucca https://doc.qt.io/qt-6/windows-deployment.html explains how plug-in should be deployed. If no plug-ins where deployed with windeployqt then something went wrong.
-
-
Believe me, I read this page many times, and even understood some of it.
I couldn't understand how to build Qt statically, nor how to use the Q_IMPORT_PLUGIN() Macro
Sorry for the delay in my answer, I'm only allowed to post something every 10 minutes
@rzucca said in No such plugin: 'peakcan':
I couldn't understand how to build Qt statically
No need to build Qt statically and also Q_IMPORT_PLUGIN should not be needed.
All you need to do is to deploy needed plugins as shown in "Creating the Application Package" part of the link. -
That's great news, thanks!
I just would like to know which plug-ins I need and where to find them
@rzucca said in No such plugin: 'peakcan':
I just would like to know which plug-ins I need
Depends on what app is using, on what platform, ...
Where to find: in your Qt installation.
Apparently you also need peakcan plug-in. -
Well, I'm using QT 6.4 on Windows 10. I think I just need the peakcan plug-in.
I already tried to copy the PCANBasic.dll to an handmade plugins subfolder, but to no avail. That's evidently not the component I'm looking for. The plug-in I need must be in the Qt folder, I guess, because Qt Creator can find it
I'm not (consciously) using any other external plug-ins or libraries. Am I missing any important piece of information?
-
@rzucca said in No such plugin: 'peakcan':
I just would like to know which plug-ins I need
Depends on what app is using, on what platform, ...
Where to find: in your Qt installation.
Apparently you also need peakcan plug-in.@jsulm There are three subfolders of Qt called plugin canbus. Their content seems to be identical, and the same that is added by windeployqt to the canbus subdirectory.
I tried to copy their content to a manually created plugin subfolder in the release, but to no avail
I am still stuck: I know that I must add some plugins to the release, but I still don't know what plugins, or where to find them