简体   繁体   English

Visual Studio交叉编译到Linux

[英]Visual Studio cross-compilation to Linux

Visual Studio 2015 has brought with itself a cross-platform support for native C++ projects. Visual Studio 2015 带来了对本机C ++项目的跨平台支持。 In this context cross-platform means Windows, Android and iOS. 在这种情况下,跨平台意味着Windows,Android和iOS。
New Visual Studio now officially supports CLang and GCC tool-chains along with its own compiler. 新的Visual Studio现在正式支持CLang和GCC工具链以及它自己的编译器。 However it doesn't support cross-compilation to Linux. 但是它不支持交叉编译到Linux。
Which, in turn, means that one still have to maintain at least two different projects in different IDEs to get native library binaries for all major operating systems. 反过来,这意味着仍然需要在不同的IDE中维护至少两个不同的项目,以获得所有主要操作系统的本机库二进制文件。

Is this possible to "cheat" on Visual Studio and enable Linux targeting by modifying parameters of native Android project and/or by modifying NDK installation? 是否可以在Visual Studio上“作弊”并通过修改本机Android项目的参数和/或修改NDK安装来启用Linux目标?
After all, Visual Studio just invokes NDK tools through a command line... 毕竟,Visual Studio只是通过命令行调用NDK工具......

Before Windows 10 Anniversary Upgrade it was possible to cross-compile to Linux from within VS with Visual C++ for Linux Development extension. Windows 10 Anniversary Upgrade之前,可以使用Visual C ++ for Linux Development扩展从VS内交叉编译到Linux。
However, you still had to setup a Linux machine (either real one or VM) since this extension supports Remote build & debugging only. 但是,您仍然需要设置Linux计算机(实际的或虚拟机),因为此扩展仅支持远程构建和调试

Windows 10 Anniversary Upgrade has introduced Windows Subsystem for Linux , which: Windows 10 Anniversary Upgrade推出了适用于Linux的Windows子系统 ,其中:

lets developers run Linux environments -- including most command-line tools, utilities, and applications -- directly on Windows, unmodified, without the overhead of a virtual machine 允许开发人员直接在Windows上运行Linux环境 - 包括大多数命令行工具,实用程序和应用程序 - 未经修改,无需虚拟机的开销

Thanks to this great feature happy owners of Windows 10 can easily setup remote cross-compilation to their localhost . 由于这个伟大的功能, Windows 10的快乐所有者可以轻松地设置远程交叉编译到他们的localhost

You can get the details either in official Microsoft blog post or here . 您可以在官方Microsoft博客文章此处获取详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM