简体   繁体   English

gnuplot:为什么 gnuplot_qt 在某些 PC 上无法启动?

[英]gnuplot: Why does gnuplot_qt fail to start on some PCs?

I have a gnuplot script which works fine on Win7 and Win10 PCs.我有一个在 Win7 和 Win10 PC 上运行良好的 gnuplot 脚本。

set term wxt size 400,400
...

However, if I switch to qt terminal it works fine on some PCs, but on others I get error messages.但是,如果我切换到qt终端,它在某些 PC 上运行良好,但在其他 PC 上我会收到错误消息。

set term qt size 400,400
...

在此处输入图片说明

在此处输入图片说明

The error message suggests to reinstall the application?错误消息建议重新安装应用程序? Which application?哪个应用程序? Which Qt platform plugin?哪个Qt平台插件? I am working with gnuplot 5.2.6 and simply unpacked gnuplot from the file gp526-win64-mingw.7z from https://sourceforge.net/projects/gnuplot/files/gnuplot/5.2.6/我正在使用 gnuplot 5.2.6 并简单地从https://sourceforge.net/projects/gnuplot/files/gnuplot/5.2.6/的文件gp526-win64-mingw.7z解压 gnuplot

What exactly do I have to reinstall to get it working everywhere?我究竟需要重新安装什么才能让它在任何地方工作?

Addition: Some more findings.补充:还有一些发现。

On those PCs where the qt-terminals didn't work, I was running gnuplot 5.2.6, however, the qt-terminals worked with gnuplot 5.2.0 on the same PCs.在那些 qt 终端不工作的 PC 上,我运行的是 gnuplot 5.2.6,但是,qt 终端在同一台 PC 上与 gnuplot 5.2.0 一起工作。 Going back to gnuplot 5.2.0 is not a solution because it doesn't have some features which I need.回到 gnuplot 5.2.0 不是一个解决方案,因为它没有我需要的一些功能。 Some differences of the "working" and "non-working" PCs were the Microsoft Visual C++ Redistributables. “工作”和“非工作”PC 的一些区别在于 Microsoft Visual C++ Redistributables。 Some PCs have the 2008,2010,2012,2013 and 2015 versions installed.部分PC安装了2008、2010、2012、2013和2015版本。 On the newest Win10 PCs there is even a 2017 version but no 2015 version.在最新的 Win10 PC 上,甚至有 2017 版,但没有 2015 版。 So, my current suspicion is that gnuplot 5.2.6 requires the 2015 version, whereas gnuplot 5.2.0 probably runs with the 2013 version.所以,我目前的怀疑是 gnuplot 5.2.6 需要 2015 版本,而 gnuplot 5.2.0 可能与 2013 版本一起运行。 If it is like this, it would have been nice if gnuplot_qt.exe told me that this or that specific version is missing.如果是这样,如果gnuplot_qt.exe告诉我缺少这个或那个特定版本,那就太好了。

Currently, I don't have access to those PCs.目前,我无法访问这些 PC。 So, further tests will take some more time.因此,进一步的测试将需要更多时间。

I have never used gnuplot, however, I have recently debugged issues with Qt plugins. 我从未使用过gnuplot,但是,我最近调试了Qt插件的问题。 From the popup it is clear that the platform plugin has been found (windows), but could not be initialized. 从弹出窗口中很明显,已找到平台插件(Windows),但无法初始化。

It might just be that the plugin DLL is somehow corrupt, or that multiple versions of Qt are available on the machine, and for some reason version A tries to load plugins from version B (and fails). 可能是插件DLL某种程度上已损坏,或者机器上有多个版本的Qt,并且由于某种原因,版本A尝试从版本B加载插件(并且失败)。

The part of Qt that loads plugins has some debug output built in. I suggest you try to enable debug output and get more information about the error: Qt加载插件的部分内置了一些调试输出。我建议您尝试启用调试输出并获取有关该错误的更多信息:

  1. Get DebugView 获取DebugView
  2. Enable plugins debug output. 启用插件调试输出。 This can be done by setting an environment variable: SET QT_DEBUG_PLUGINS=1 这可以通过设置环境变量来完成: SET QT_DEBUG_PLUGINS=1
  3. Start DebugView 启动DebugView
  4. Start gnuplot from the command line where you set the variable 从设置变量的命令行启动gnuplot
  5. Look for messages from gnuplot in DebugView. 在DebugView中从gnuplot查找消息。 There might be some noise depending on what else is running in the system. 可能会有些噪音,具体取决于系统中正在运行的其他物品。 DebugView collects output from all applications, but you can easily filter and search. DebugView收集所有应用程序的输出,但是您可以轻松地进行过滤和搜索。

Debug messages should at least show exact paths to plugins that are being loaded. 调试消息至少应显示正在加载的插件的确切路径。 Most likely some additional information about the error will be shown too. 最有可能还会显示有关该错误的一些其他信息。

It's difficult to say without minimal code. 没有最少的代码很难说。 But it looks like you didn't correctly deploy your application. 但是看来您没有正确部署应用程序。 1) you should use windeployqt tool to create redistributable build. 1)您应该使用windeployqt工具创建可再发行版本。 2) you need to configure your app correctly with config: qt.conf . 2)您需要使用config: qt.conf正确配置您的应用程序。 Ask if you need more help. 询问是否需要更多帮助。

PS I got very difficult bug, when I got installed qt and redistributable qt on one PC. PS:当我在一台PC上安装qt和可再发行qt时,我遇到了一个非常棘手的错误。 I found an answer here . 我在这里找到了答案。

There is an answer in the question问题中有答案

In Gnuplot use the command在 Gnuplot 中使用命令

set term wxt设置术语 wxt

This is a quick fix that got around this problem.这是解决此问题的快速解决方案。 - nothing was plotting before with the plot command. - 之前没有使用 plot 命令进行绘图。 There was an error message complaining about qt.有一条错误消息抱怨 qt。 Afterwards using this command in Gnuplot all the plot commands worked fine.之后在 Gnuplot 中使用此命令,所有绘图命令都运行良好。

I post this answer here because it is a simple fix that sorted out the issue for me.我在这里发布这个答案,因为它是一个简单的修复,为我解决了这个问题。

I run in a similar problems few months ago with another software that was using Qt on Windows. 几个月前,我在使用Windows上使用Qt的另一个软件时遇到了类似的问题。

I do not have a final solution for your problem but those are some of the steps I followed to fix the problem. 对于您的问题,我没有最终的解决方案,但是这些是我为解决问题而采取的一些步骤。

1. Ensure you have a clean windows 1.确保您的窗户清洁

In order to ensure that your configuration will run in all Windows version, try to setup a clean installation with no third-party dependency installed. 为了确保您的配置将在所有Windows版本上运行,请尝试设置没有安装第三方依赖项的全新安装。

Sometimes, you will find that you have installed several packages in the past that makes your system compatible with the software you are running. 有时,您会发现过去安装了多个软件包,这些软件包使您的系统与正在运行的软件兼容。 In order to avoid that, try to install a clean version if you are planning to release an installation or setup that must run in different PCs. 为了避免这种情况,如果打算发布必须在其他PC上运行的安装或设置,请尝试安装一个干净的版本。

Extract the folder an try to run it. 提取文件夹尝试运行它。 If it does not run, try to install Qt and add it to the system path. 如果它没有运行,请尝试安装Qt并将其添加到系统路径。

2. Find missing dependencies 2.查找缺少的依赖项

I used DependencyWalker to find the missing dlls, if any in my system. 我使用DependencyWalker查找丢失的dll(如果系统中有)。

Create a new folder and extract the files you just downloaded. 创建一个新文件夹并解压缩刚刚下载的文件。 Open with DepencyWalker the binaries you are going to run. 用DepencyWalker打开要运行的二进制文件。

This software will tell you if you need to install any third-party library that is missing in your system (download them for MinGw from this page ). 该软件将告诉您是否需要安装系统中缺少的任何第三方库(可从此页面为MinGw下载它们)。

Normally, you should add all those dlls into the 'bin/' folder. 通常,您应该将所有这些dll添加到“ bin /”文件夹中。

Be aware that some of the dlls may be installed in one system and not in others because of the different Windows version they are using. 请注意,由于使用的Windows版本不同,某些dll可能安装在一个系统中,而不是安装在其他系统中。

If DependencyWalker is not complaining anymore, zip the folder and try to run it in other systems. 如果DependencyWalker不再抱怨,请压缩文件夹并尝试在其他系统中运行它。

3. Deploy for an installed Qt version 3.部署已安装的Qt版本

Qt provides a tool to copy all the dependencies from Qt that a binary need to run properly. Qt提供了一种从Qt复制二进制文件需要正确运行的所有依赖项的工具

The Windows deployment tool windeployqt is designed to automate the process of creating a deployable folder containing the Qt-related dependencies (libraries, QML imports, plugins, and translations) required to run the application from that folder. Windows部署工具windeployqt旨在自动执行创建可部署文件夹的过程,该文件夹包含从该文件夹运行应用程序所需的Qt相关依赖项(库,QML导入,插件和翻译)。 It creates a sandbox for Windows Runtime or an installation tree for Windows desktop applications, which can be easily bundled into an installation package. 它为Windows运行时创建了一个沙箱,或者为Windows桌面应用程序创建了一个安装树,可以将它们轻松捆绑到安装包中。

After installing Qt, try to run this tool in all the binaries to replace/updates the Qt dependencies in order to fix the problems with the Qt plugins. 安装Qt后,尝试在所有二进制文件中运行此工具以替换/更新Qt依赖项,以解决Qt插件的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM