[英]Compiling my C++ exe for Linux with VS2019
通常要为 Linux 构建 C++ 应用程序,您必须首先使用将为目标操作系统构建的编译器。 在这种情况下,VS2019(及其关联的编译器)仅为 Windows 构建可执行文件。
如果您尝试定位 Linux,您有两种选择:
You can move over to a Linux system and build your project with the GNU c++ compiler (I recommend using CMAKE to build your project since it's not tied to any particular IDE and can generate makefiles for gcc). https://cmake.org/cmake-tutorial/
您可以为 Linux (WSL) 安装 Windows 子系统,并使用 VS2019 进行远程构建。 这些天你会在生产环境中看到越来越多的这种情况。 https://devblogs.microsoft.com/cppblog/linux-development-with-c-in-visual-studio-2019-wsl-asan-for-linux-separation-of-build-and-debug/
希望这可以帮助!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.