how to compile a cpp program in ubuntu

Asked by Paramesh

how to compile a cpp program done in windows in Linux(Ubuntu). I have written a cpp program in ubuntu.but when i compiled it,it gives the warnings
'cout' was not declared in the scope
'cin' was not declared in the scope.
why does this come so.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gedit Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Dmitry Mityugov (dmitry-mityugov) said :
#1

To compile a C++ program in Ubuntu, you will need to install build-essential package. You may also need to install documentation from these packages: glibc-doc, manpages-dev, gcc-4.1-doc, libstdc++6-4.1-doc. After that, run this command: g++ and specify all source files as parameters (like *.cpp). If the compiler finds no errors, you'll get an "executable" file a.out in current directory. To change its name during build step, pass -o parameter to g++

Can you help with this problem?

Provide an answer of your own, or ask Paramesh for more information if necessary.

To post a message you must log in.