However, it needs a recent version of CMake that has server mode enabled (at least 3.8). Visual Studio also of course requires CMake. ![]() sudo apt install -y openssh-server build-essential gdb zip ![]() On Debian based systems you can install these dependencies as follows. The tools Visual Studio requires to be present on the Linux machine are: C++ compilers, GDB, ssh, and zip. That can be on a physical machine, in a VM, the cloud, or even running on Windows Subsystem for Linux. Visual Studio does not have a requirement for a specific distribution of Linux use any you would like to. Configuring your Linux machine for cross platform C++ development Once that is done you are ready to go on Windows. This minimal install is only a 3GB, depending on your download speed installation should not take more than 10 minutes. If you don’t have Visual Studio installed use this link to install it with the minimal set of components for this tutorial selected. If you have it installed already confirm that you have the Desktop development with C++ and Linux development with C++ workloads installed. The next section shows you how to setup Visual Studio, followed by a section on how to configure your Linux target, and last the tutorial itself – have fun! Setting up Visual Studio for Cross Platform C++ Developmentįirst you need to have Visual Studio installed. Then Visual Studio will add a connection to a Linux machine and edit, build and debug it on that remote machine. If you follow the tutorial below on your own machine, you will clone an open source project from GitHub, open it in Visual Studio, edit, build and debug on Windows with no changes to the project. Visual Studio isn’t just for Windows C and C++ development anymore. If or when additional configuration is needed it is saved in flat json files that can be saved locally, or shared in source control with other developers using Visual Studio without impacting developers that are not using it. You can use Visual Studio in an environment like this without perturbing your other team members or making changes to your source as is. ![]() In an environment like this, the choice of tools may be up to the developers themselves. some people are on Linux (and may be using the Visual Studio Code editor) and some are on Windows (probably using the Visual Studio IDE). Teams working on these types of code bases may have developers who have different primary operating systems, e.g. ![]() You can quickly be editing, building and debugging your code locally on Windows, and then switching your configuration to do the same on Linux all from within Visual Studio. Visual Studio will recognize CMake is being used, then use metadata CMake produces to configure IntelliSense and builds automatically. Just open the folder with your sources in Visual Studio (File > Open Folder). You can use Visual Studio for your C++ cross platform development when using CMake without needing to create or generate Visual Studio projects. If you are using the same codebase for multiple targets, then CMake is the most common solution for building your software. For up-to-date documentation see Create C++ cross-platform projects in Visual Studio.A great strength of C++ is the ability to target multiple platforms without sacrificing performance.
1 Comment
|
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |