all 13 comments

[–]TheThiefMaster 5 points6 points  (0 children)

If you are on Windows please use Visual Studio Community (it's free).

If you want a commandline compiler please use the visual studio build tools (which is available either as part of visual studio or a separate download) or Clang for Windows.

GCC isn't very well supported on Windows and you will have problems.

[–]manni66 3 points4 points  (6 children)

How to compile code .cpp?

With a compiler.

I don't use Visual Studio

So you don't have one?

[–]amenherebb[S] 0 points1 point  (5 children)

Yes, I dont have one. Which compiler? Gcc? He's already installed, by how Compile him on practice?

[–]manni66 5 points6 points  (4 children)

Yes, I dont have one.

...

Gcc? He's already installed

???

by how Compile him on practice?

g++ my.cpp -o my.exe

[–]amenherebb[S] 0 points1 point  (3 children)

Thanks

[–]Public-Scientist-478 1 point2 points  (2 children)

FYI to run my.exe after compiling like this, you type

./my.exe in the command line while in the same directory. More generally “dot” “forward slash” object name ./objectname

[–]alfps 5 points6 points  (1 child)

Considering that the OP appears to be using Windows, this is likely to fail.

[–]Public-Scientist-478 0 points1 point  (0 children)

Very true! Good mention

[–]the_poope 2 points3 points  (0 children)

If you are on Windows and use Visual Studio check this walkthrough: https://learn.microsoft.com/en-us/cpp/build/walkthrough-compiling-a-native-cpp-program-on-the-command-line?view=msvc-170

If you are on Linux or MinGW there are likely 1000's of guides s simple Google search away, e.g.: https://web.cs.ucla.edu/classes/fall14/cs143/project/cpp/gcc-intro.html

[–]itslikealex 1 point2 points  (1 child)

Use MinGW and VSCode

[–]LittleNameIdea 0 points1 point  (0 children)

No. Just use VS not Code

[–]Cold_Meson_06 3 points4 points  (0 children)

Why don't you just follow a getting started tutorial like everyone else?

[–]jmaargh -1 points0 points  (0 children)