简体   繁体   English

无法在未安装 VS2017 的另一台机器上运行使用 VS2017 构建的 C++ 应用程序

[英]Not able to run C++ application built with VS2017 on another machine where VS2017 is not installed

I have VS2017 installed on windows 10 machine and I am building my C++ code in it.我在 Windows 10 机器上安装了 VS2017,我正在其中构建我的 C++ 代码。 when build success I am able to run that exe on same machine.当构建成功时,我可以在同一台机器上运行该 exe。 But when I am copying that exe (with all dependent DLL's) on another winodws 10 machine where VS2017 is not installed its giving error "The code execution cannot proceed because urctbase.dll was not found" .但是,当我在另一台未安装 VS2017 的 winodws 10 机器上复制该 exe(带有所有依赖的 DLL)时,它给出了错误“代码执行无法继续,因为未找到 urctbase.dll”

I copied those dll's (ucrtbase.dll vcrutime140.dll etc.) at the same location where exe resides and try to run it then its giving error "The application was unable to start correctly(0xc700000b). Click OK to close the application"我在 exe 所在的同一位置复制了那些 dll(ucrtbase.dll vcrutime140.dll 等)并尝试运行它,然后出现错误“应用程序无法正确启动(0xc700000b)。单击确定关闭应用程序”

I installed VC Redistributable-2017 package to setup run time environment on that machine, but problem persists.我安装了 VC Redistributable-2017 包来在该机器上设置运行时环境,但问题仍然存在。

Can anyone help to resolve this issue?任何人都可以帮助解决这个问题吗?

it's difficult to get all the dependent DLLs of your program.很难获得程序的所有依赖 DLL。 I suggest you create setup project that can detect all these dependencies:我建议您创建可以检测所有这些依赖项的setup project

0- Put your project in release mode 0-将您的项目置于release模式
1- install Microsoft Visual Studio Installer Projects from here 1-这里安装Microsoft Visual Studio Installer Projects
2- Add setup project to your VS solution 2-将安装项目添加到您的VS solution

在此处输入图片说明

3- Add your program to the setup project 3-将您的程序添加到安装项目

在此处输入图片说明

4- Choose primary output of your project 4-选择项目的主要输出

在此处输入图片说明

5- As you can see, visual studio detect all dll dependencies 5-如您所见,visual studio 检测所有 dll 依赖项
在此处输入图片说明

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

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