Visit the LQ Articles and Editorials section
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


LinkBack Search this Thread
Old 04-10-2009, 09:29 PM   #1
LQ Newbie
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Compiling on Ubuntu

I'm new with Linux and I tried the "Hello World!" program, but i cannot compile it. My friend tried explaining it to me over the phone but all i got was "G++ -o" and i dont know what goes after that and i dont even know if that is right.
My file looks like this.. but i dont know if this is relevant

// my first program in C++
#include <iostream>
using namespace std;
int main ()
cout <<"Hello World!";
return 0;
Old 04-10-2009, 09:35 PM   #2
Senior Member
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,754

Rep: Reputation: Disabled
One nice way of knowing the development tools is by reading the description in synaptic.

What are the c++ and c compilers called?

install kdevelop
Old 04-10-2009, 10:19 PM   #3
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,570

Rep: Reputation: 510Reputation: 510Reputation: 510Reputation: 510Reputation: 510Reputation: 510
g++ file.c -o file.out

if you don't have g++/gcc/make/etc, install the build-essentials package via Synaptic
Old 04-11-2009, 01:40 AM   #4
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2013.07, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,196

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
  • sudo apt-get install build-essential
will provide 'gcc' and 'g++' and then some more, you need for compiling.
( Remember : only two s's in build-essential ! )


c++, compiling, g++, linux, ubuntu

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with Compiling on Ubuntu Akinjide Programming 6 03-05-2009 06:08 AM
ubuntu Compiling kernel jordanguyoflove Linux - Newbie 1 10-27-2008 02:14 AM
Compiling tcng in ubuntu 8.04 Primeiro Linux - Software 7 09-18-2008 08:57 AM
Compiling kernel 2.4.25 on ubuntu 8.04 freddo Linux - Kernel 3 08-27-2008 07:26 PM
compiling exmap on Ubuntu 8.04 Ryzol Linux - Software 3 06-11-2008 10:49 PM

All times are GMT -5. The time now is 01:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration