本文介绍了PATH环境如何影响我的运行可执行文件使用msvcr90到msvcr80?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  #include< gtk / gtk.h> 

int main(int argc,char * argv [])
{
GtkWidget * window;

gtk_init(& argc,& argv);

window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_widget_show(window);

gtk_main();

return 0;
}



我尝试了各种版本的 MSVCR80.dll 在与生成的可执行文件(通过 cmake )相同的目录下,但没有匹配。



这种问题有没有一般解决方案?



UPDATE



答案建议安装VS redist,但我不知道它是否会影响我安装的Visual Studio 9,有人可以确认吗?



清单文件可执行文件

 < assembly xmlns =urn:schemas-microsoft-com:asm.v1 1.0> 
< trustInfo xmlns =urn:schemas-microsoft-com:asm.v3>
< security>
< requestedPrivileges>
< requestedExecutionLevel level =asInvokeruiAccess =false>< / requestedExecutionLevel>
< / requestedPrivileges>
< / security>
< / trustInfo>
< dependency>
< dependentAssembly>
< assemblyIdentity type =win32name =Microsoft.VC90.DebugCRTversion =9.0.21022.8processorArchitecture =x86publicKeyToken =1fc8b3b9a1e18e3b>< / assemblyIdentity>
< / dependentAssembly>
< / dependency>
< / assembly>

清单文件似乎应该使用 MSVCR90 ,为什么它总是报告缺少 MSVCR80.dll



FOUND



花了几个小时后,最后我发现它是由 PATH 中的这个设置引起的:

  D:\MATLAB\R2007b\bin\win32 

删除后,所有工作都可以正常工作。为什么可以使用 msvcr90 msvcr80

解决方案

回答主题问题,即使gtk应用程序需要Microsoft库,因为它不试图模仿Windows窗口小部件的外观和行为。相反,gtk使用本机API来绘制小部件。即使你用MinGW编译器编译你的程序仍然需要MSVCR。



尝试查看makefile来得到一个想法,为什么cmake不能正确链接。 >

#include <gtk/gtk.h>

int main( int argc, char *argv[] )
{
    GtkWidget *window;

    gtk_init (&argc, &argv);

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_widget_show  (window);

    gtk_main ();

    return 0;
}

I tried putting various versions of MSVCR80.dll under the same directory as the generated executable(via cmake),but none matched.

Is there a general solution for this kinda problem?

UPDATE

Some answers recommend install the VS redist,but I'm not sure whether or not it will affect my installed Visual Studio 9, can someone confirm?

Manifest file of the executable

<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.DebugCRT" version="9.0.21022.8" processorArchitecture="x86" publicKeyToken="1fc8b3b9a1e18e3b"></assemblyIdentity>
    </dependentAssembly>
  </dependency>
</assembly>

It seems the manifest file says it should use the MSVCR90, why it always reporting missing MSVCR80.dll?

FOUND

After spending several hours on it,finally I found it's caused by this setting in PATH:

D:\MATLAB\R2007b\bin\win32

After removing it all works fine.But why can that setting affect my running executable from using msvcr90 to msvcr80 ???

解决方案

Answering the topic question, even gtk application needs Microsoft libraries because it doesn't try to emulate look and behavior of Windows widgets. Instead, gtk uses native APIs to draw widgets. Even if you compile with MinGW compiler your program would still need MSVCR.

Try to look into makefiles to get an idea, why doesn't cmake link properly.

这篇关于PATH环境如何影响我的运行可执行文件使用msvcr90到msvcr80?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 09:48