Download your favorite Linux distribution at LQ ISO.
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!


  Search this Thread
Old 04-10-2009, 10: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, 10:35 PM   #2
Senior Member
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

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, 11:19 PM   #3
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613
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, 02:40 AM   #4
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2017 CentOS6.9 CentOS7.3 + 50+ other Linux OS, for test only.
Posts: 16,741

Rep: Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318Reputation: 3318
  • 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

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

All times are GMT -5. The time now is 09:11 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration