[英]C runtime library loaded incorectly -QT
我有一個QT應用程序,它使用依賴於2008 C ++ MSVCR90.dll的LIB。 當我部署應用程序時,在某些計算機上會出現以下錯誤:
我該如何解決這個問題? 有人向我提到,如果我包含清單文件,這會有所幫助。 所以我准備了以下清單文件:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="asInvoker" uiAccess="false"></requestedExecutionLevel>
</requestedPrivileges>
</security>
</trustInfo>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.VC90.CRT" version="9.0.21022.8" processorArchitecture="*" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
</dependentAssembly>
</dependency>
</assembly>
在.pro文件中,我添加了以下內容:
CONFIG += embed_manifest_exe
win32:CONFIG(release, debug|release) {
QMAKE_POST_LINK = $$quote(C:/Program Files (x86)/Windows Kits/8.1/bin/x64/mt.exe -nologo -manifest \"ISHEmulauncher.exe.manifest\" -outputresource:$(DESTDIR_TARGET);1)
}
else:win32:CONFIG(debug, debug|release) {
QMAKE_POST_LINK = $$quote(C:/Program Files (x86)/Windows Kits/8.1/bin/x64mt.exe -nologo -manifest \"ISHEmulauncher.exe.manifest\" -outputresource:$(DESTDIR_TARGET);1)
}
但是創建的清單與我准備的清單不同,並且不包含VS90依賴關系,因此我仍然面臨相同的錯誤。
有什么建議么? 謝謝!
可再發行內容非常煩人。 通常,我需要做的是在每台部署計算機上運行MSVC C ++可重新分發的安裝程序(作為安裝過程的一部分),以避免出現此錯誤。
這里的文章可能會闡明這種情況:
http://msdn.microsoft.com/en-us/library/ms235299(v=vs.90).aspx
https://qt-project.org/doc/qt-5.0/qtdoc/deployment-windows.html#application-dependencies
我試圖從開發機上刪除正確的dll,然后將其部署到應用程序的文件夾中。 如果您不介意在安裝程序中再安裝可再發行軟件包的步驟,那么下面的鏈接應該會有所幫助。
http://www.microsoft.com/en-us/download/details.aspx?id=29
http://www.microsoft.com/en-us/download/details.aspx?id=26368
同樣,如果您的應用程序是針對32位編譯的,則只需32位可再發行組件。 如果您使用x64編譯應用程序,則需要64位可再發行文件。
有關:
希望能有所幫助。
我通過取消選中QT中的“陰影生成”選項解決了該問題。 之后,我定義的清單文件不會被忽略,並且庫已正確加載。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.