我可以运行C++在任何其他PC中编译了EXE?
我已经在C ++上制作了游戏,现在我想与朋友分享该游戏。因此,我与我的朋友分享了该编译的EXE文件,但这给了他 - 崩溃和DLL错误之类的错误。
那么,他如何在不下载mingw/编译器的情况下成功运行该EXE文件?
我已经使用了这些库: -
#include <iostream>
#include <string>
#include <unistd.h>
#include <windows.h>
我尝试运行编译的C ++ EXE文件以在另一台PC中运行。
我希望它应该成功在没有的情况下运行任何错误。
I have made a game in c++ and now I want to share that game with my friends. So, I shared that compiled exe file with my friend, but it gives him errors like - crashing and dll errors.
So, how he can run that exe file successfully without downloading mingw/compiler?
I have used these libraries :-
#include <iostream>
#include <string>
#include <unistd.h>
#include <windows.h>
I tried run compiled c++ exe file to run in another pc.
I am expecting that it should successfully run without any errors.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您静态链接您的库,它应该运行良好,只要它是兼容的操作系统/环境。如果您的库是动态链接的,那么在应用程序运行时期间,您的库应该以DLL文件的形式存在。
在这里,您似乎正在动态链接 C++ 运行时,这就是导致问题的原因。要么让你的朋友安装适当的运行时环境,要么静态链接它。
If you link your libraries statically, it should run fine, provided it's a compatible OS/environment. If your libraries are linked dynamically, then during the runtime of the application, your libraries should be present in the form of DLL files.
Here it seems like you're dynamically linking the C++ runtime, and that is causing the issue. Either have your friend install the appropriate runtime environment, or link it statically.