3

I have been using Visual Studio for quite awhile and am getting pretty comfortable at it. I still consider myself a newbie and have a lot to learn (especially the different tools vs has for debugging)

I am aware that VS is not supported for Linux and while I can 'learn' a new IDE that is available in linux such as Eclipse or use text editors, I would like to devote my time 'mastering' visual studio (get better at debugging more importantly).

So my question is, is it possible to wite my C++ code in windows visual studio, then when I am confident that no bugs exist, that the code is fully optimized, bring the source and header files over to linux (and use make to compile it ? I just recently found out about make)

I hope the question makes sense. Basically I would prefer to not have to learn another IDE and just do all my coding in windows visual studio..

Kong
  • 2,202
  • 8
  • 28
  • 56
  • 2
    See http://stackoverflow.com/q/3103568/10077 – Fred Larson Jul 01 '16 at 15:49
  • 1
    Yes. You can always move source code to another place and compile. Do note that just because it compiles and runs on MSVS does not mean it will somewhere else. That depends on how standard conformant your code is and the compilers. – NathanOliver Jul 01 '16 at 15:50
  • Try clion (https://www.jetbrains.com/clion/) – Daniel Jul 01 '16 at 16:07

3 Answers3

4

Assuming you use no Windows specific headers, API's and your code adheres strictly to standard C++ and uses no Visual Studio specific extentions etc. And you are able to write a Makefile for it for Linux. Then the answer to your question is yes.

Note that if you don't regularly test your code on Linux during development it can be really hard to do (this is why you should set up a continuous integration system like Jenkins or buildbot from the beginning and have them do a build on all platforms every time you do a commit).

Jesper Juhl
  • 30,449
  • 3
  • 47
  • 70
2

Yes, I do this (although I use Xcode on a mac). My projects cross-compile onto windows, mac, ios, linux and android.

however

you must write standards-compliant code.

Richard Hodges
  • 68,278
  • 7
  • 90
  • 142
0

Yes. Furthermore, you can use Visual Studio to directly develop on a remote Linux machine if you install the Visual C++ for Linux Development extension.

Nemanja Trifunovic
  • 24,346
  • 3
  • 50
  • 88