QT示例可执行文件将无法运行,缺少QT5Cored.dll [英] QT example executables won't run, missing QT5Cored.dll
问题描述
QT5Cored.dll在我的系统上@:C:\Qt\5.4\mingw491_32\bin文件夹
Analogclock示例和其他项目将运行在IDE中,但不能从创建的.exe文件运行。当EXE被启动时,QT5Cored.dll丢失错误发生。
QT安装它&不知道它在哪里?
已删除&重新安装QT具有相同的结果。
>
已下载耳环今天。
版本:3.3.1,QT 5.4.1(MSCV 2010,32 Bit),建于2015年2月20日。
p>
将DLL填充添加到exe目录后的新错误。
要在Qt Creator之外运行它,您有两种选择:
- 将缺少的DLL复制到可执行文件所在的目录。例如,如果
analogclock.exe
在c:\examples
,则复制C: \Qt\5.4\mingw491_32\bin/\\Qt5Cored.dll
和其他必需的DLL到c:\examples
。您可能还需要复制插件文件。 - 将
C:\Qt\5.4\mingw491_32\bin
添加到PATH
环境变量。
有一些方法可以复制缺失的DLL:
1。使用Windows部署工具(windeployqt.exe)复制所需文件
- 使用以下方法之一打开命令提示符:
- 如果使用MSVC作为编译器,请打开正确的Visual Studio命令提示符。例如对于VS2013 32位,单击
开始 - > Microsoft Visual Studio 2013 - > Visual Studio工具 - > VS2013 x86本机工具命令提示符
。这将使用正确设置的VCINSTALLDIR
环境变量打开命令提示符。windeployqt.exe
需要此环境变量才能复制正确的Visual C ++可再发行的可执行文件。 - 如果使用MinGW,只需打开命令提示符。
- 如果使用MSVC作为编译器,请打开正确的Visual Studio命令提示符。例如对于VS2013 32位,单击
-
添加Qt二进制路径和可选
g ++。exe
路径到PATH环境变量。如果您的可执行文件是32位,请添加32位Qt二进制路径,例如:c:\Qt\5.4\\\\\\\\bin\">
。如果你的可执行文件是64位的,添加64位的Qt二进制路径,例如:c:
windeployqt.exe
将从此目录复制DLL,所以重要的是不要为64位可执行文件设置32位Qt二进制路径,反之亦然。你需要添加g ++。exe
路径如果你使用MinGW,windeployqt将从那里复制lib * .dll。; MSVC的示例路径32位
PATH = c:\Qt\5.4\msvc2013\bin;%PATH%
; MinGW 32位,g ++。exe的示例路径位于C:\Qt\Tools\明w491_32\bin
PATH = C:\Qt\5.4\mingw491_32\bin; C: \Qt\Tools\mingw491_32\bin;%PATH%
-
code> windeployqt.exe 将可执行文件作为参数。例如:
windeployqt.exe C:\Qt\Examples\Qt-5.4\widgets\richtext\ build-calendar-Desktop_Qt_5_4_0_MSVC2013_32bit-Debug\debug\calendar.exe
-
检查输出错误或警告。以下是没有错误和警告的输出:
2。手动复制DLL
您必须复制正确的DLL(32位或64位)。使用类似 Process Explorer 的工具来查找正确的DLL路径:
- 从Qt Creator / Visual Studio运行应用程序。
- 打开Process Explorer。
- 在进程资源管理器中
- 单击可执行文件,例如
calendar.exe
- 按
Ctrl + D
在下面板中显示加载的DLL。等效菜单为视图 - >下面板视图 - > DLL
- 在下面的面板中,单击
路径
- 单击可执行文件,例如
- 将DLL复制到可执行文件所在的目录。例如在下图中。 DLL来自C:\Qt\5.4\msvc2013\bin。
- 如果您的可执行档使用类似
c:\Qt\5.4\msvc2013\plugins\platforms\qwindowsd.dll
。它也应该被复制。但是从platforms
目录,而不是plugins
复制。让我们说calendar.exe
的完整路径是c:\examples\calendar.exe
,然后qwindowsd.dll
应复制到c:\examples\platforms\qwindows.dll
,而不是c:\examples\plugins\platforms\qwindows.dll
。 -
您还需要复制C ++运行时库。如果您使用mingw,您可能需要复制
libgcc_s_dw2-1.dll
,libstdc ++ - 6.dll
。libwinpthread-1.dll
等。检查Process Explorer以确保。如果使用MSVC,则需要部署运行时(例如:msvcp120.dll
,msvcr120.dll
)。最后,您的目录结构是这样的:c:\examples\calendar.exe
c :\examples\Qt5Cored.dll
c:\examples\Qt5Widgetsd.dll
c:\examples\Qt5Guid.dll
c:\examples\icudt53.dll
c:\examples\icuin53.dll
c:\examples\icuuc53.dll
c:\examples\libgcc_s_dw2-1.dll(如果使用mingw)
c:\\ \\ examples \libstdc ++ - 6.dll(如果使用mingw)
c:\examples\libwinpthread-1.dll(如果使用mingw)
c:\examples\platforms\qwindowsd.dll
QT5Cored.dll is on my system @: C:\Qt\5.4\mingw491_32\bin folder
The Analogclock example and other projects will run in the IDE, but can Not be run from the created .exe files. When the EXE is launched the QT5Cored.dll missing error occurs. QT installed it & doesn’t know where it is? Removed & reinstalled QT with same results.
Downloaded earler today. Version: 3.3.1, QT 5.4.1(MSCV 2010, 32 Bit), Built on Feb 20, 2015.
Any suggestions appreciated.
New error after DLL filles added to exe directory.
To run it outside of Qt Creator, you have two choices:
- Copy the missing DLLs to the directory where the executable resides. For example if
analogclock.exe
is inc:\examples
, then copyC:\Qt\5.4\mingw491_32\bin\Qt5Cored.dll
and other required DLLs toc:\examples
. You may need to copy plugins files too. - Add
C:\Qt\5.4\mingw491_32\bin
to thePATH
environment variable.
There are some ways to copy the missing DLLs:
1. Use Windows Deployment Tool (windeployqt.exe) to copy required files
- Open Command Prompt in one of the following way:
- If you use MSVC as compiler, open the correct Visual Studio Command Prompt. For example for VS2013 32-bit, click
Start -> Microsoft Visual Studio 2013 -> Visual Studio Tools -> VS2013 x86 Native Tools Command Prompt
. This will open a Command Prompt with theVCINSTALLDIR
environment variable correctly set.windeployqt.exe
requires this environment variable to copy the correct Visual C++ redistributable executable. - If you use MinGW, just open a Command Prompt.
- If you use MSVC as compiler, open the correct Visual Studio Command Prompt. For example for VS2013 32-bit, click
Add Qt binary path and optionally
g++.exe
path to PATH environment variable. If your executable is 32-bit, add the 32-bit Qt binary path, eg:c:\Qt\5.4\msvc2013\bin
. If your executable is 64-bit, add the 64-bit Qt binary path, eg:c:\Qt\5.4\msvc2013_64\bin
.windeployqt.exe
will copy DLLs from this directory, so it is important that you don't set 32-bit Qt binary path for a 64-bit executable, vice versa. You need to addg++.exe
path too if you use MinGW, windeployqt will copy lib*.dll from there.; Example path for MSVC 32-bit PATH=c:\Qt\5.4\msvc2013\bin;%PATH% ; Example path for MinGW 32-bit, g++.exe is in C:\Qt\Tools\mingw491_32\bin PATH=C:\Qt\5.4\mingw491_32\bin;C:\Qt\Tools\mingw491_32\bin;%PATH%
Run
windeployqt.exe
with your executable file as argument. Eg:windeployqt.exe C:\Qt\Examples\Qt-5.4\widgets\richtext\build-calendar-Desktop_Qt_5_4_0_MSVC2013_32bit-Debug\debug\calendar.exe
Check the output for error or warning. The following is an output without error and warning:
2. Manually copy the DLLs
You must copy the correct DLLs (32-bit or 64-bit). Use a tool like Process Explorer to find the correct DLL paths:
- Run the application from Qt Creator / Visual Studio.
- Open Process Explorer.
- In Process Explorer
- Click the executable, for example
calendar.exe
- Press
Ctrl+D
to show loaded DLLs in the lower panel. The equivalent menu isView -> Lower Panel View -> DLLs
- In the lower panel, click the
Path
column to sort by path.
- Click the executable, for example
- Copy the DLLs to the directory where the executable resides. For example in the following picture. The DLLs are from C:\Qt\5.4\msvc2013\bin.
- If your executable uses something like
c:\Qt\5.4\msvc2013\plugins\platforms\qwindowsd.dll
. It should be copied too. But copy from theplatforms
directory, notplugins
. Let's saycalendar.exe
's full path isc:\examples\calendar.exe
, thenqwindowsd.dll
should be copied toc:\examples\platforms\qwindows.dll
, notc:\examples\plugins\platforms\qwindows.dll
. You need to copy C++ runtime library too. If you are using mingw, you may need to copy
libgcc_s_dw2-1.dll
,libstdc++-6.dll
.libwinpthread-1.dll
etc too. Check in Process Explorer to be sure. If you are using MSVC, you need to deploy the runtime (Eg:msvcp120.dll
,msvcr120.dll
). At the end, your directory structure is something like this:c:\examples\calendar.exe c:\examples\Qt5Cored.dll c:\examples\Qt5Widgetsd.dll c:\examples\Qt5Guid.dll c:\examples\icudt53.dll c:\examples\icuin53.dll c:\examples\icuuc53.dll c:\examples\libgcc_s_dw2-1.dll (if using mingw) c:\examples\libstdc++-6.dll (if using mingw) c:\examples\libwinpthread-1.dll (if using mingw) c:\examples\platforms\qwindowsd.dll
这篇关于QT示例可执行文件将无法运行,缺少QT5Cored.dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!