-2

I have installed g++ in Ubuntu 12.04 from Ubuntu software center to write, c and c++ and to complie, but I am not able to find out where is the software gone after installation, please help me how to find it.

4
  • What have you tried, exactly? What happens if you open a terminal (Ctrl+Alt+T) and type which g++ or g++ --version? Aug 13 '15 at 22:33
  • g++: fatal error: no input files compilation terminated.
    – riemann
    Aug 14 '15 at 6:03
  • Yes that error comes
    – Marso
    Aug 14 '15 at 6:05
  • That isn't really an error. You have started g++ without a source-code file.
    – A.B.
    Aug 14 '15 at 7:10
0

Simply start:

dpkg -L g++

to list all installed files for the package g++ or use:

which g++

to show the path for the command g++


Write a "hello world"

  1. Open a sour-code file

    nano helloworld.cpp
    
  2. Add the code below

    #include <iostream>                                     
    int main(){                                             
        std::cout << "Hello world" << std::endl;
        return 0;                                           
    }
    
  3. Save the file

  4. Compile

    g++ helloworld.cpp -o helloworld
    
  5. Start

    ./helloworld
    
3
  • dpkg -L g++ /. /usr /usr/bin /usr/share /usr/share/man /usr/share/man/man1 /usr/share/doc /usr/bin/i686-linux-gnu-g++ /usr/bin/g++ /usr/share/man/man1/i686-linux-gnu-g++.1.gz /usr/share/man/man1/g++.1.gz /usr/share/doc/g++
    – riemann
    Aug 14 '15 at 6:02
  • Yes that error comes
    – Marso
    Aug 14 '15 at 6:06
  • @LaBelleNoiseuse Which error?
    – A.B.
    Aug 14 '15 at 7:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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