LinuxQuestions.org
Help answer threads with 0 replies.
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, 03: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, 03: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 03:46 PM.
 
Old 07-20-2009, 06:02 PM   #3
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 02: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 02:37 PM
Compiling a module separately without compiling entire kernel kushalkoolwal Linux - Kernel 8 08-06-2008 02:45 AM
Various Compiling Errors (GCC compiling Openal, GUIlib, xmms-wma) gregorya Linux - Software 2 08-27-2004 06:03 AM
Compiling in ACPI support on Compaq 2135CA (system crashes while compiling) Dag Linux - Laptop and Netbook 20 07-30-2004 08:56 PM
Kernel compiling and module compiling tarballed Linux - General 1 12-22-2002 06:31 PM

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

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