[英]Visual Studio C++ Project for Linux, how to run .out file?
Im using Visual Studio 2022 and have created a C++ project for linux.我使用 Visual Studio 2022 并为 linux 创建了一个 C++ 项目。
I followed this article: https://learn.microsoft.com/en-us/cpp/linux/connect-to-your-remote-linux-computer?view=msvc-170我关注了这篇文章: 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.并通过 Visual Studio 中的远程调试在 Linux 中获得了一个正在运行的 OpenGL 应用程序。
I see a.out-file in Linux but I can not run it.我在 Linux 中看到了一个.out 文件,但我无法运行它。
So, how do I compile an executable file, so I can run it on Linux Mint?那么,如何编译可执行文件,以便在 Linux Mint 上运行它? I am using Linux Mint.
我正在使用 Linux Mint。
As you are using linux, you can use cpp
or g++
for compiling your code.当您使用 linux 时,您可以使用
cpp
或g++
来编译您的代码。 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
. Linux 通常有 g++。通过
g++ filename.cpp
运行它,你会得到一个名为 a.out 的 ELF 文件,你可以通过命令./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.如果您无法运行或您的代码使用
ls -la
命令检查文件模式,并且如果您在文件模式中找不到字母 -x,则使用命令chmod +x filename
。希望这可以解决问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.