如何编写原生 C++在 VS 2022 中,使用 Linux 进行构建和测试

发布于 2025-01-15 11:57:50 字数 205 浏览 4 评论 0原文

我需要一个本机 C++ 应用程序来从头开始制作。它必须在 Linux (CentOS) 上运行。我想用VS2022来编写和测试。我有带有 CentOS 的 Hyper-V 虚拟机。

我尝试用 google 搜索解决方案,但只有使用 WSL 的帖子。

有人可以描述一下将 VS 连接到 Linux VM 而不是 WSL 的步骤,以便我可以在 VM 上构建和运行应用程序。

I need a native C++ app to make from scratch. It has to run on linux (CentOS). I want to use VS2022 to write and test. I have Hyper-V VM with CentOS.

I tried to google a solution but there are only posts for using WSL.

Can someone please describe steps to connect VS to Linux VM instead of WSL so I can build and run the app on the VM.

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

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

发布评论

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

评论(1

捎一片雪花 2025-01-22 11:57:50

本文介绍了该过程:https://devblogs .microsoft.com/cppblog/linux-development-with-c-in-visual-studio/

  • 使用 VS 安装程序(Linux 和嵌入式..)向 VS 添加工作负载
  • 创建正确类型的项目
  • 在中添加 SSH 凭据项目属性(也可以在工具-选项-跨平台中添加/删除/编辑)

This article describes the process: https://devblogs.microsoft.com/cppblog/linux-development-with-c-in-visual-studio/

  • add workload to the VS using VS Installer (Linux and embedded..)
  • create project of correct type
  • add SSH credentials in the project Properties (also can be added/removed/edited in Tools-Options-Cross Platform)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文