简体   繁体   English

为 Windows 构建 C++ 程序

[英]Build c++ program for windows

I have troubles running an executable compiled from a c++ source with visual studio 2015 on a recently installed windows(without installed visual) studio .我在最近安装的 windows(未安装 Visual) studio 上运行从 c++ 源编译的可执行文件与 Visual Studio 2015 时遇到问题。

When I run it i receive this error: -the procedure entry point terminate could not be located in the dynamic link library -path-\\VCRUNTIME140.dll (the dll and the executable are in the same directory)当我运行它时,我收到此错误:-过程入口点终止无法位于动态链接库中 -path-\\VCRUNTIME140.dll(dll 和可执行文件在同一目录中)

As tom mentioned, you seem to have a problem with redistributable package, here's how you can fix it:正如汤姆所提到的,您似乎对可再发行包有问题,以下是修复它的方法:

  • Right click on your project in solution explorer在解决方案资源管理器中右键单击您的项目
  • Go to properties转到属性
  • Under "Configuration Properties", select "General"在“配置属性”下,选择“常规”
  • Look for "Use of MFC" and set it to "Use MFC in a static library"查找“使用 MFC”并将其设置为“在静态库中使用 MFC”
  • Rebuild code重建代码

*It's recommended to do that for all your configurations (on the top-left corner, select "Configuration" as "All configurations" *建议对所有配置都这样做(在左上角,选择“配置”作为“所有配置” 在此处输入图片说明

Solved!解决了! in the directory with the executable were required:在具有可执行文件的目录中需要:

msvcp140d.dll
vcruntime140d.dll
ucrtbased.dll

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

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