Is it possible to develop a C ++ application in Visual Studio to run on Linux?

3

I have to develop an application for Linux in C ++ and wanted to know if it is good to use Visual Studio 2017 on Windows for such a task?

I wanted to know the pros and cons, because I saw that VS has an extension for it.

    
asked by anonymous 15.09.2017 / 15:32

2 answers

4

If it's good it's a matter of opinion and I'll abstain.

It's possible and a lot of people do. Microsoft's C ++ meets the C ++ 17 standard (the last of this year) by almost 100% and, if I'm not mistaken, I already have 100% of C ++ 14 or at least of C ++ 11, which few people use all that has just entered the pattern.

C ++ comes with Visual Studio and you might as well use it. Some people like to use Resharper C ++ with add-on, even if it has cost. Remembering that VS Community is very complete and free .

The C ++ compiler allows you to do cross platform executions, so even Windows can generate the executable for Linux. It is even possible to remotely debug the application on Linux. But it is still possible to run the Linux executable in the current Windows itself (technically it is a container with an Ubuntu). But you can debug as Windows executable and only in the end generate a Linux executable. If you make portable code, the recommended one, it's quiet.

For my workflow is how I would do it, especially the last option.

    
15.09.2017 / 15:40
1

Even with the ease of compiling cross-platform provided by Visual Studio 2017 , it would still be a specific implementation is required for each operating system.

This happens because the operating systems that implement the POSIX standard (such as Windows and Linux) provide < a different programming interfaces (APIs)

Even using a programming language quite like portable like C ++, it would still be It is necessary to implement a specific code to interact with each of the APIs of the various existing operating systems.

The same thing happens with the step of debug , which always happens at runtime and will always be done in "unorthodox" .

If the question of portability and multiplatform compilation is a very important and relevant factor for your project, maybe JAVA is a more adequate language than C ++, which rules out all the complexities mentioned here .

    
18.09.2017 / 17:07