简体   繁体   English

我需要什么C ++程序包才能运行程序?

[英]What C++ packages do i need to run a program?

I created a C# application that uses a C++ dll and im trying to create an install package that will allow this to run on other computers whether they have VS or not, the problem is i don't know what C++ libraries i need to let it do this. 我创建了一个使用C ++ dll的C#应用​​程序,并尝试创建一个安装包,该安装包将使其在具有VS或不具有VS的其他计算机上运行,​​问题是我不知道我需要让什么C ++库运行做这个。 When i run just the application on a blank virtual machine it says " xxxx has encountered a problem and needs to close." 当我仅在空白虚拟机上运行该应用程序时,它会显示“ xxxx遇到问题,需要关闭”。 If i go and download visual studio 2008 express version and install it on the machine, the my program will run fine. 如果我去下载Visual Studio 2008 Express版本并将其安装在计算机上,则我的程序可以正常运行。 problem is express is 85-185mb to download and 335mb up to 1.1gb to install on a machine, the program that is using it is only 33kb. 问题是在机器上下载的是85-185mb的下载,最大为1.1gb的是335mb,正在使用它的程序只有33kb。 huge overhead there... if i install just the C++ redistributable from msdn site, it takes up 4mb, but it wont let me run my program. 那里的开销很大...如果我只安装从msdn站点可再发行的C ++,它将占用4mb,但是它不会让我运行我的程序。

what packages from C++ do i need to make this program run on a blanked computer? 我需要什么C ++软件包才能使此程序在空白计算机上运行?

That question can be tough to answer. 这个问题很难回答。 If you have the source of the c++ dll you should be able to see its dependencies unless the person used a lot of com or load library calls. 如果您拥有c ++ dll的源代码,则除非该人员使用了大量com或加载库调用,否则您应该能够查看其依赖关系。 One of the best tools I used to get c++ depencany info was depends.exe . 我用来获取c ++火山喷发信息的最佳工具之一是depends.exe One thing to check if its your code is that you are not using debug version with dependencies on debug dll that I think are not in the redistributable. 要检查其代码是否是您要使用的调试版本是否与依赖于我认为不在可再发行版本中的调试dll相关的一件事。

caleb, I recommend you a program called Dependency Walker . caleb,我建议您使用一个名为Dependency Walker的程序。 It will show you all the dll dependencies you have. 它将显示您具有的所有dll依赖项。 I'm sure there are much more of them for Windows but that's the one I've been using for quite a while and I like it. 我敢肯定,其中有很多Windows版本,但这就是我已经使用了一段时间了,我喜欢它。 So you did right by downloading the redistributable package from the MS web site but your app probably depends on some other libraries. 因此,您通过从MS网站下载可再发行软件包进行了正确的操作,但您的应用程序可能依赖于某些其他库。 When I tried to build my installer long time ago using Visual Studio I remember it was a way to include a redistributable package in your installer or use side-by-side installation - depending whether the license agreement of your Visual Studio version allowed you to do that or not. 很久以前,当我尝试使用Visual Studio来构建安装程序时,我记得这是在安装程序中包含可重新分发程序包或使用并行安装的一种方法-这取决于您的Visual Studio版本的许可协议是否允许您执行那还是不。 Also you could include all the dll dependencies you have in the installer. 另外,您可以包括安装程序中所有的dll依赖项。

Hope that helps 希望能有所帮助

The C++ runtime dlls you need are the ones provided with the compiler as redistributable package and exactly this one! 您需要的C ++运行时dll是与编译器一起作为可再发行软件包提供的dll,而正是这个软件包! Other redist packages won't necessary work because of the manifests embedded in the executables which require an exact version (checked by a hash value of the binaries in the side by side assembly directory C:\\Windows\\SxS) 其他Redist软件包将不需要工作,因为嵌入在可执行文件中的清单需要精确的版本(由并排汇编目录C:\\ Windows \\ SxS中的二进制文件的哈希值检查)

So you are right with the redistributable but you need the one that was installed with the compiler not one from a best guess from the internet. 因此,您可以正确使用可再发行组件,但是您需要的是随编译器一起安装的组件,而不是互联网上的最佳猜测。 The exact versions can be looked at in the manifest files (XML) 确切的版本可以在清单文件(XML)中查看

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

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