Sunday, June 17, 2012

Quick Start C++ in Linux Mint/Ubuntu/Debian Hello World

1) Install C and C++ Compilers in Mint 

      sudo aptitude install build-essential 


2) Compile the first Program sudo gedit first.c add the following lines save and exit the file



            #include int main() { printf("Hello world\n"); return 0; } 


3) Firstly compile the code using the following command 

     cc -c first.c 
 that would produce an object file you may need to add to the library.


 4) then create an executable using the following command 

 cc -o first first.c


 5) Now run this executable using the following command

 ./first