Command Shells for making programs
There are 2 ways for making programs (executable files, such as .exe, .com etc.)
1. Using IDEs – IDE = Integrated Development Environment – This is a program. Some are free, some are paid. Each one has their text editors, debuggers, compilers and by clicking only one button “build & run” you can make .exe file and run it. IDE can work as in specific OS platform so it could be cross-platform program, it can be oriented as only one programming language so some. One benefit of IDEs is that they have Visual constructor: you can make Windows-based application by your mause. Common IDEs are: Visual Studio, Eclipse, RadASM etc.
2. Directly using compiler by command shells. Each OS (operating system) has it’s specific command shell. If your computer has low RAM or you need to write little program this way is the best and quickest.
How to make executable file under Windows OS:
The specific command shell for Windows family is called Command Prompt or cmd. (command.com in DOS).
You can find it so:
1. Start – Run – write in the text box "cmd" and press OK.
2. Start – All Programs – Accessories – command prompt.
3. My Computer – WindowsDrive(Commonly C Drive) – Windows – system32 – cmd.exe.
After this you will see this: Looks below the tutorial for images.
1. Using IDEs – IDE = Integrated Development Environment – This is a program. Some are free, some are paid. Each one has their text editors, debuggers, compilers and by clicking only one button “build & run” you can make .exe file and run it. IDE can work as in specific OS platform so it could be cross-platform program, it can be oriented as only one programming language so some. One benefit of IDEs is that they have Visual constructor: you can make Windows-based application by your mause. Common IDEs are: Visual Studio, Eclipse, RadASM etc.
2. Directly using compiler by command shells. Each OS (operating system) has it’s specific command shell. If your computer has low RAM or you need to write little program this way is the best and quickest.
How to make executable file under Windows OS:
The specific command shell for Windows family is called Command Prompt or cmd. (command.com in DOS).
You can find it so:
1. Start – Run – write in the text box "cmd" and press OK.
2. Start – All Programs – Accessories – command prompt.
3. My Computer – WindowsDrive(Commonly C Drive) – Windows – system32 – cmd.exe.
After this you will see this: Looks below the tutorial for images.
Command shell has specific place for working, as u see here it is C:\Documents and Settings\Admin\
My compiler for C language (gcc.exe) is here C:\Dev-Cpp\projects
So I must change it to my directory. For this actions I use command cd
Write cd then write new directory and press enter:
Figure 1.2
Look below for the image
As you see the directory is changed.
Now lets compile our main.c file. If you hasn’t it open any text editor write this:
My compiler for C language (gcc.exe) is here C:\Dev-Cpp\projects
So I must change it to my directory. For this actions I use command cd
Write cd then write new directory and press enter:
Figure 1.2
Look below for the image
As you see the directory is changed.
Now lets compile our main.c file. If you hasn’t it open any text editor write this:
Code Editor
Save as main.c file.
Compilers work so: They get arguments (variables or text) which we send by cmd, then they make execute file and instantly will close.
gcc input filename –o output file name
for example:
"gcc main.c –o file.exe"
Press enter it will make file.exe in your directory.
Then write the name of file and press enter it will run it.
Figure 1.3
Again look below for the image
As you see it works perfectly. If I check it by windows explorer I will see the file in directory:
Figure 1.4
Try to make your own application now!!! Good Luck
Compilers work so: They get arguments (variables or text) which we send by cmd, then they make execute file and instantly will close.
gcc input filename –o output file name
for example:
"gcc main.c –o file.exe"
Press enter it will make file.exe in your directory.
Then write the name of file and press enter it will run it.
Figure 1.3
Again look below for the image
As you see it works perfectly. If I check it by windows explorer I will see the file in directory:
Figure 1.4
Try to make your own application now!!! Good Luck
Written by George from Georgia
Figure 1.3
Shows the GNU C Compiler(GCC.exe) compiling.And also shows the program after execution.
Figure 1.4
You can see the compiled file, file.exe.