Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am a brand new engineering student, my teacher told us that we need to program in C++, I am new to programming and to Ubuntu, I am installing the latest version of Ubuntu but I would like to know what else do I need to program in C++, I've been told to install Kate, can you please tell me what else I need? and where to find documentation related to programming and the programs I need? than you very much!

share|improve this question
1  
You should ask this on the coding stackexchange. Your question has no relation to Ubuntu by itself (you can code on any OS). –  Rinzwind Jan 14 '12 at 18:32
4  
What you need is a platform (Ubuntu), an editor (like Kate but that is KDE. You can also use gedit. Have a look in ubuntu software center for editors ;) ) and some manuals or tutorials to start ( cplusplus.com/doc/tutorial ). and of you go!! –  Rinzwind Jan 14 '12 at 18:34
4  
A c++ compiler is a pretty good thing to have as well. –  Zoke Jan 14 '12 at 18:47
    
@Rinzwind: cplusplus.com has quite a few errors and some terrible examples; anyone who actually wants to learn is far better off getting themselves a good book. –  Anton Golov Jan 14 '12 at 23:33
add comment

closed as off topic by Rinzwind, binW, htorque, Jorge Castro, fossfreedom Jan 15 '12 at 10:17

Questions on Ask Ubuntu are expected to relate to Ubuntu within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

3 Answers

You'll need to :

  • write code: a text editor of your choice (gedit by default or xemacs, vi, etc...) or an IDE (i'll recommend codeblocks or Eclipse + eclipse-cdt, etc.)
  • manage your code: aka use a Version Control System, optional at first while learning but you'll benefit from knowing git or mercurial once you'll start working on non-trivial projects.
  • compile code: install build-essential (includes g++, make, C headers, etc., don't go for a manual install of the compiler) sudo apt-get install build-essential
  • debug it: don't think you'll ever be able to skip this step ^^ sudo apt-get install gdb
share|improve this answer
7  
+1 for mentioning version control –  queueoverflow Jan 14 '12 at 19:57
2  
LMGTFY is not polite. –  jrg Jan 18 '12 at 0:09
    
Look, considering i took some time to politely answer the question, i could just have said "google for some c++ tutorials to learn the language once you've installed everything you needed, i won't write one because the are lot of them around the web" but instead preferred to add a lmgtfy link to point out that i don't want to pollute my answer with info easily available with a search engine. So please, consider this a humorous note because so was my intention. I'm aware this can be use in a rude way but so are many of the words we use ^^ –  Maxime R. Jan 18 '12 at 0:42
    
There are also many people that found it funny ;) meta.stackoverflow.com/q/15650/155165 –  Maxime R. Jan 18 '12 at 0:43
    
@MaximeR I found it funny, however, not everyone else does. :) –  jrg Jan 18 '12 at 0:44
show 1 more comment

You need an editor (Use one you like, gedit is preinstalled for Ubuntu, I, myself, prefer SciTE) and a c++ compiler.

The c++-compiler (g++) is found in the package g++. I would however recommend installing the package build-essential, it will install some more useful packages.

g++ can be invoked on the command-line like this: g++ source.cpp -o myprogram

Later when your programs will get more functions you will probably need some extra libraries. You can find them most easily via apt-cache search. Library packages have the suffix -dev or the prefix lib, e.g. zlib1g-dev for the compression library.

share|improve this answer
add comment

I would recommend to install eclipse if you intend to start coding in c++. It is a good IDE to familiarize yourself with as it has support for Java and Python among others to consider for the future; also it is the best supported IDE for developing android apps.

sudo apt-get install eclipse
share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.