Visual Studio C++ Linux项目,如何运行.out文件?

发布于 2025-01-21 16:03:22 字数 814 浏览 5 评论 0原文

我正在使用Visual Studio 2022,并为Linux创建了一个C ++项目。

我遵循了这篇文章: https:https:https: ///learn.microsoft.com/en-us/cpp/linux/connect-to-your-remote-linux-computer?view=MMSVC-170

并通过远程调查在Linux中运行OpenGl-application视觉工作室。

我在Linux中看到了一个.out-file,但我无法运行它。

那么,如何编译可执行文件,以便在Linux Mint上运行它?我正在使用Linux Mint。

Im using Visual Studio 2022 and have created a C++ project for linux.

I followed this article:
https://learn.microsoft.com/en-us/cpp/linux/connect-to-your-remote-linux-computer?view=msvc-170

And got a running OpenGL-application in Linux via Remote Debugging in Visual Studio.

enter image description here

I see a .out-file in Linux but I can not run it.

enter image description here

So, how do I compile an executable file, so I can run it on Linux Mint? I am using Linux Mint.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

我的奇迹 2025-01-28 16:03:22

当您使用Linux时,您可以使用CPPg ++来编译代码。 Linux通常具有G ++。通过g ++ filename.cpp运行它,您将获得一个名为A.Out的小精灵文件,您可以通过命令./ a.out执行此操作。
如果您无法运行或使用ls -la命令查看文件模式,并且如果您在文件模式下找不到字母-x,请使用命令chmod +x文件名。希望这解决了问题。

As you are using linux, you can use cpp or g++ for compiling your code. Linux usually have the g++. Run it by g++ filename.cpp and you will get a ELF file named a.out, you can execute this by the command ./a.out.
If you couldn't run or your code check for the modes on file with ls -la command and if you can't find the letter -x in your files mode then use the command chmod +x filename .Hope this solves the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文