Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
Pages: (3) </ 1 2 [3] >/

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: Compiler< Next Oldest | Next Newest >
clacker Offline





Group: Members
Posts: 570
Joined: June 2004
Posted: April 03 2006,14:53 QUOTE

Cypher, try this example program called hello.cpp

Code Sample
#include <iostream>

using namespace std;

int main()
{
  cout << "Hello World" << endl;
  return 0;
}


Enter this into a text editor (if you don't know open beaver from the icon and use that) and save it as hello.cpp in your home directory (/home/dsl).

To compile it, open an xterminal (which should put you in the /home/dsl directory) and enter the command line:

g++ -o hello hello.cpp

This should produce and executable called hello, so type hello in the shell and hit return and it should print the hello message.  gcc is the C compiler, g++ is the c++ compiler.  You might want to run the g++ program from the same directory that your *.cpp files are in until you get used to paths and such.
Back to top
Profile PM 
10 replies since Mar. 31 2006,06:37 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

Pages: (3) </ 1 2 [3] >/
reply to topic new topic new poll
Quick Reply: Compiler

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code