[英]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.