compile with cmd

closed account (28poGNh0)
I compile with VS and Code::blocks

I hope to know how to compile a cpp file using cmd .If that's possible

also what is a command line?
Last edited on
A command line a console.
You can compile in cmd by:

cd (your directory)
g++ examplefilename.cpp -o whatyouwantexecutabletobenamed
closed account (28poGNh0)
I does not recongnize g++ ,can you know why?
Try using gcc not g++

Also, it depends on your compiler. There is most likely some resources on the developers website.
Last edited on
closed account (28poGNh0)
also not recongnized
Command line is a (about to use the same words in definition...) a line of command given to the operating system (shell in linux) and based on the actions specified, the os will do something.

To compile with command line on windows, you need to download mingw
http://www.mingw.org/

Instructions to install:
http://www.mingw.org/wiki/InstallationHOWTOforMinGW

If you are on linux, open a terminal (ctrl+alt+t) and type:
sudo apt-get install gcc
Enter password and when installation is done, type:
sudo apt-get update

To compile with linux, follow the instructions given by @ostrichparty101
Topic archived. No new replies allowed.