Step 4Make the Program!
Type:
->kwrite ./your_program_here.cpp
your_program_here is where you put the name of your new program... (don't forget the .cpp)
this opens up a kwrite window
TYPE THAT CODE!
If you decided not to pay attention and did not learn C++, then I'll give you a simple "Hello World" program to test with.
Hello World Program:
(Start at the line under this one)
#include <iostream>
using namespace std;
main ( )
{
cout << "Hello World!";
cout << endl;
system("pause");
return 0;
}
(End at line above this one)
Hit save and exit kwrite.
back at the terminal type:
->g++ -g -o ./your_final_program_here ./your_original_program_here.cpp
Thanks to annex666 for catching that mistake
your_final_program_here is where you put the name of your final program (its wise to name it the same as your .cpp file)
Hit 'Enter'
Let g++ do it thing...(might take a while)
test it by typing:
->clear; ./your_final_program_here
If it works, close the terminal
If it doesn't, make sure that your terminal is in the same folder as your program.
Then try typing:
->./your_final_program_here
(make sure that you type the correct name of your program where 'your_final_program_here'
is and don't add the '.cpp' Executable programs in Linux don't have any extensions.)
The 'clear;' that went in front of your program just scrolls the terminal down so that it appears clean.
| « Previous Step | Download PDFView All Steps | Next Step » |
1
comment
|
Add Comment
|
![]() |
Add Comment
|












































