LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-20-2009, 02:41 PM   #1
migueljc
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
compiling c++


I have recently installed ubuntu operating system. upon doing so I do not know how to compile my c++ programs, I thought the highlighter was cool and very helpful for mistakes. but still I can't compile my c++ programs any help would be very helpfull, thank you very much.
 
Old 07-20-2009, 02:42 PM   #2
chigurh8
Member
 
Registered: Jul 2009
Distribution: Ubuntu, Gentoo
Posts: 102

Rep: Reputation: 18
Code:
sudo apt-get install g++
For c++, it is the GNU compiler ...

To just compile:
Code:
g++ your.c -o your
resulting in the executable file "your"

To use the warnings:
Code:
g++ -Wall your.c -o your

Last edited by chigurh8; 07-20-2009 at 02:46 PM.
 
Old 07-20-2009, 05:02 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
If it still doesn't work after the "install g++" also try
an
Code:
apt-get install build-essential



Cheers
Tink
 
Old 08-02-2009, 01:32 PM   #4
joeBuffer
Member
 
Registered: Jul 2009
Distribution: Ubuntu 9.04
Posts: 328

Rep: Reputation: 42
Yeah, build-essential also contains it. Plus, c++ and g++ are the same thing.
 
  


Reply


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
Good but sorta easy guide to Kernel compiling/Re-Compiling? linus72 Linux - General 1 07-13-2009 01:37 PM
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 01:45 AM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 05:03 AM
Compiling in ACPI support on Compaq 2135CA (system crashes while compiling) Dag Linux - Laptop and Netbook 20 07-30-2004 07:56 PM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 05:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:37 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration