-2

I don't know how to compile or run a code in vim. I'm searching everywhere but there is no noob-friendly answer. (A good Youtube tutorial would also be nice) Also, excuse my English I'm not a native speaker.

SealsRock12
  • 161
  • 2
  • 13
Kedog
  • 29
  • 3
  • 2
    Welcome to Stack Overflow. Please learn [how to ask a good question](https://stackoverflow.com/help/how-to-ask), [what kinds of questions you can ask](https://stackoverflow.com/help/on-topic), [what kind of questions to avoid](https://stackoverflow.com/help/dont-ask). – Michael Chourdakis May 26 '20 at 17:20
  • 5
    An editor (`vim`) is used to edit source code. A *compiler* is used to compile it. What editor you use to manipulate your source files matters *not at all* to the compiler. You can build your code in any way you please, the editor doesn't matter. What's the actual question? – Jesper Juhl May 26 '20 at 17:26
  • Answers to your question have already been provided for g++-mingw, or for VC++ compiler. What's your compiler? – Luc Hermitte May 26 '20 at 23:34

3 Answers3

1

First, you need a compiler. This largely depends on which platform you want to use. As @Pablochaches said in a previous answer, you can use MinGw if you want GNU/Unix support. If you are interested in making programs for windows, you can use the answer in this thread to download Visual Studio/Visual C++. Once you do that, you can follow this Microsoft support post to compile it.

SealsRock12
  • 161
  • 2
  • 13
0

If you want to compile the code from the terminal you can install MinGw. Then you add the bin folder to the PATH environment variable. Then you can compile using

g++ file.cpp -o output.exe
Pablochaches
  • 968
  • 10
  • 25
-1

To compile and run your code you use compilers and linkers. For example, you can use Build Tools for Visual Studio which include compilers, linkers, assemblers, and other build tools, and matching libraries. You can use all of these tools at the command line. After installation you can use Developer Command Prompt to compile and run your code. Assuming you have an app.cpp file, the following line compiles your code:

>cl app.cpp

Of course you can use any other compiler you are comfortable with.

Omid
  • 286
  • 1
  • 5
  • 20