用于Linux和Raspberry Pi开发的Visual C ++

It's bananas over at Microsoft. Last week they announced you can run Bash on Ubuntu on Windows 10, and now I'm seeing I missed an announcement of an extension to Visual Studio that enables Visual C++ for Linux Development.

在Microsoft看来,这是香蕉。 上周他们宣布您可以在Windows 10的Ubuntu上运行Bash ,现在我错过了关于Visual Studio扩展的公告,该扩展启用了Visual C ++进行Linux开发

With this extension you can author C++ code for Linux servers, desktops and devices. You can manage your connections to these machines from within VS. VS will automatically copy and remote build your sources and can launch your application with the debugger. Their project system supports targeting specific architectures, including ARM which means Raspberry Pi, folks.

通过此扩展,您可以为Linux服务器,台式机和设备编写C ++代码。 您可以从VS中管理与这些计算机的连接。 VS将自动复制并远程构建您的源代码,并可以使用调试器启动您的应用程序。 他们的项目系统支持针对特定架构的目标,包括ARM(即Raspberry Pi )。

ASIDE: I also noticed there's a C/C++ extension for Visual Studio Code also. I need to add that to my list of stuff to check out, it looks pretty compelling as well.

ASIDE:我还注意到Visual Studio Code有C / C ++扩展。 我需要将其添加到我的东西列表中以进行签出,它看起来也很有吸引力。

Once Visual C++ for Linux Development is installed, you go and File New Project like this. Cool to see Linux in that list along with a Raspberry Pi project.

安装用于Linux开发的Visual C ++之后,您就可以像这样归档新项目了。 很高兴在该列表中看到Linux和Raspberry Pi项目。

File New | Linux App

You can pick x86, x64, and ARM, and you can see Remote GDB Debugger is an option.

您可以选择x86,x64和ARM,并且可以看到Remote GDB Debugger是一个选项。

Remote GDB Debugger

Here I'm running Ubuntu in a VM and connecting to it over SSH from Visual Studio. I needed to set up a few things first on the Ubuntu machine

在这里,我在VM中运行Ubuntu,并通过SSH从Visual Studio连接到它。 我首先需要在Ubuntu机器上进行一些设置

sudo apt-get install openssh-server g++ gdb gdbserver

Once that was setup, connecting to the remote Linux machine was pretty straightforward as VS is using SSH.

设置完成后,由于VS使用SSH,因此连接到远程Linux机器非常简单。

Debugging C++ apps remotely talking to a Linux VM

Pretty cool.

很酷

NOTE: Today this cool extension has nothing to do with the Bash on Ubuntu on Windows announcement or that subsystem.  The obvious next question is "can I use this without a VM and talk to gdb on the local Linux subsystem?" From what I can tell, no, but I'm still trying to get SSH and GDB working locally. It's theoretically possible but I'm not sure if it's also insane. Both teams are talking, but again, this feature isn't related to the other.

注意:今天,这个很棒的扩展与Windows上的Ubuntu公告上的Bash或该子系统无关。 显而易见的下一个问题是:“我可以在没有VM的情况下使用它,并与本地Linux子系统上的gdb对话吗?” 据我所知,没有,但是我仍在尝试使SSH和GDB在本地运行。 从理论上讲这是可能的,但我不确定这是否也很疯狂。 两个团队都在交谈,但是同样,此功能与另一个无关。

This extension feels a little beta to me but it does a good job providing the framework for talking to Linux from VS. The team looks to be very serious and even has a cool demo where they code and debug a Linux desktop app.

这个扩展对我来说有点beta,但是它很好地为从VS与Linux的对话提供了框架。 该团队看起来非常认真,甚至有一个很棒的演示,他们在其中编码和调试Linux桌面应用程序

If you're looking for a another full featured solution for Linux and Embedded Systems development with Visual Studio, be sure to download and check out VisualGDB, it's amazing.

如果您正在寻找另一种使用Visual Studio开发Linux和嵌入式系统的全功能解决方案,请务必下载并查看VisualGDB ,这真是太好了

翻译自: https://www.hanselman.com/blog/visual-c-for-linux-and-raspberry-pi-development

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值