There is always some trouble when you want to compile your C++ code on a Linux PC.But this is not anymore.Here is what you have to do:
1.Download the g++ package.Its advisable to use the software center for a direct link to the repository.
2.Once the application has installed successfully it will have a checked emblem thats green in color.
3.Run your IDE.If you are using Eclipse there is no need to configure manually but if you are on Netbeans this is a must.What to do is:compile your source file,then a dialog box will appear and you will be required to point to the directory that has your compiler or alternatively just click restore defaults and Netbeans will search the compiler for you.You should also note that eclipse and Netbeans uses the JRE(Java Runtime Environment).
Nice times and success with your c/c++ code