3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

Create C++ Programs on the EEE PC

Step 4Make the Program!

Make the Program!
Go to the place where you want to have the program be in the console.

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 StepDownload PDFView All StepsNext Step »
1 comment
Aug 3, 2008. 9:28 AMannex666 says:
The command line in the third image is incorrect - the name of the output should be placed directly after the -o flag, e.g: g++ -g -o my_binary source_1.cpp source_2.cpp

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
1
Followers
4
Author:mattameo213