LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices

Reply
 
Search this Thread
Old 04-10-2009, 09:29 PM   #1
Susko80
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++ file.cc -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
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,758

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
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,647

Rep: Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524Reputation: 524
g++ file.c -o file.out
./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
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,984

Rep: Reputation: 2610Reputation: 2610Reputation: 2610Reputation: 2610Reputation: 2610Reputation: 2610Reputation: 2610Reputation: 2610Reputation: 2610Reputation: 2610Reputation: 2610
  • 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 ! )
 
  


Reply

Tags
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 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 11:08 PM.

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