Visual Studio C++ Linux项目,如何运行.out文件?
我正在使用Visual Studio 2022,并为Linux创建了一个C ++项目。
并通过远程调查在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.
I see a .out-file in Linux but I can not run it.
So, how do I compile an executable file, so I can run it on Linux Mint? I am using Linux Mint.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您使用Linux时,您可以使用
CPP
或g ++
来编译代码。 Linux通常具有G ++。通过g ++ filename.cpp
运行它,您将获得一个名为A.Out的小精灵文件,您可以通过命令./ a.out
执行此操作。如果您无法运行或使用
ls -la
命令查看文件模式,并且如果您在文件模式下找不到字母-x,请使用命令chmod +x文件名
。希望这解决了问题。As you are using linux, you can use
cpp
org++
for compiling your code. Linux usually have the g++. Run it byg++ 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 commandchmod +x filename
.Hope this solves the problem.