qtcreator - exe 在 qtcreator 内部工作正常,但不在外部 [英] qtcreator - exe does work fine inside qtcreator but doesn't outside
问题描述
我想给我的一个朋友一个小项目的发布版本.从 qtcreator 内部启动时它工作得非常好,但在双击 .exe 文件时无法打开.它甚至没有给我错误消息.
I want to give a friend of mine a release build of a little project. It works perfectly fine when started from inside qtcreator, but doesn't open when double-clicked on the .exe file. It doesn't even give me an error message.
现在,当我尝试在我的 exe 文件旁边复制一些 Qt .dll 文件(如 Qt5Core.dll、Qt5Gui.dll、Qt5Widgets.dll)时,它并没有改变任何东西.我如何知道我的项目有哪些依赖项?.pro 文件并没有告诉我太多
Now when I tried to copy a few Qt .dll files (like Qt5Core.dll, Qt5Gui.dll, Qt5Widgets.dll) next to my exe file, it didn't change anything. How can I know what dependencies my project has? The .pro file doesn't tell me so much
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = project1
TEMPLATE = app
SOURCES += main.cpp
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
我正在使用基于 Qt 5.0.0(32 位)的 Windows 7(64 位)、Qt Creator 2.6.1
I'm working on Windows 7 (64 bit), Qt Creator 2.6.1 based on Qt 5.0.0 (32 bit)
感谢您的帮助萨迪克
可以在我的回答中看到解决方案
edit: solution can be seen in my answer
推荐答案
解决了!我所要做的就是下载libEGL.dll"并将其放在我的exe文件所在的目录中.当然也需要来自 qt 的所有其他 .dll 文件.但是这些在错误消息中明确提到.但是对于libEGL.dll",甚至没有错误消息.可以忽略dependency walker"中列出的 .dll 文件.对于我的问题,这个工具并没有真正帮助.它没有列出 libEGL.dll,但列出了其他实际上未使用的 .dll 文件.
Solved it! All I had to do was to download "libEGL.dll" and put it in the directory where my exe file is located. Of course all the other .dll files from qt were needed, too. But these were explicitly mentioned in an error message. But for the "libEGL.dll" there is not even an error message. The .dll files that were listed in "dependency walker" can be ignored. For my problem this tool didn't really help. It didn't list the libEGL.dll but listed other .dll files which are in fact unused.
这篇关于qtcreator - exe 在 qtcreator 内部工作正常,但不在外部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!