step to get c++ compiler in ubuntu 10.10

Asked by abul ehtesham

i m not able to compile c++ in ubuntu 10.10
give me details of each step how to get it and necessary command

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu build-essential Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

sudo apt-get install build-essential

done

Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#2

Install the build-essential package, then please read the already answered questions: https://answers.launchpad.net/ubuntu/+source/build-essential

Revision history for this message
Adnan Quaium (adnan.quaium) said :
#3

1. Just run the following command in the terminal first: (it'll install all the necessary packages)

sudo aptitude install build-essential

2. Now you need to write your program/code. For that, create and open a file named test.cpp with the following command:

sudo gedit test.cpp

3. Paste the following C++ code into the text file:

#include <iostream>

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

4. Save and exit the text file. Now run your C++ program with the following command:

g++ test.cpp -o test

5. The Output should show as follows:

Hello World!

Revision history for this message
abul ehtesham (abulehtesham) said :
#4

this command is not running

________________________________
From: Adnan Quaium <email address hidden>
To: <email address hidden>
Sent: Mon, 1 November, 2010 5:07:11 AM
Subject: Re: [Question #132011]: step to get c++ compiler in ubuntu 10.10

Your question #132011 on build-essential in ubuntu changed:
https://answers.launchpad.net/ubuntu/+source/build-essential/+question/132011

Adnan Quaium proposed the following answer:
1. Just run the following command in the terminal first: (it'll install
all the necessary packages)

sudo aptitude install build-essential

2. Now you need to write your program/code. For that, create and open a file
named test.cpp with the following command:

sudo gedit test.cpp

3. Paste the following C++ code into the text file:

#include <iostream>

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

4. Save and exit the text file. Now run your C++ program with the following
command:

g++ test.cpp -o test

5. The Output should show as follows:

Hello World!

--
If this answers your question, please go to the following page to let us
know that it is solved:
https://answers.launchpad.net/ubuntu/+source/build-essential/+question/132011/+confirm?answer_id=2

If you still need help, you can reply to this email or go to the
following page to enter your feedback:
https://answers.launchpad.net/ubuntu/+source/build-essential/+question/132011

You received this question notification because you are a direct
subscriber of the question.

Revision history for this message
abul ehtesham (abulehtesham) said :
#5

Thanks actionparsnip, that solved my question.

Revision history for this message
abul ehtesham (abulehtesham) said :
#6