Find the answer to your Linux question:
Results 1 to 7 of 7

Thread: error using gcc

Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined! Runn3r.cze's Avatar
    Join Date
    Jul 2007
    Location
    czech republic
    Posts
    93

    error using gcc


    when i try to compile any source codes using
    Code:
    gcc sourcefile.cpp -o compiledfile
    i always get this error
    Code:
    cpp: error trying to exec 'cc1plus': execvp: No such file or directory
    what does it mean?

  2. #2
    Linux Engineer rcgreen's Avatar
    Join Date
    May 2006
    Location
    the hills
    Posts
    1,134
    Try installing g++

  3. #3
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Indeed. The problem here is that gcc defaults to the C language. You're trying to interpret a C++ program as a C one, which never ends well.

    The 'g++' command is still gcc, but it uses C++ as the default language. Alternatively, you could use 'gcc -x c++'.

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined! Runn3r.cze's Avatar
    Join Date
    Jul 2007
    Location
    czech republic
    Posts
    93
    ok, so i used g++ to compile it, but when i try to run the compiled file, i get an other error... permission denied. but the permissions are 777, so why can't i run it?

  6. #5
    Linux Guru Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,252
    Run the command:
    Code:
    ls -l compiledfile
    and tell us the output.

  7. #6
    Quote Originally Posted by Runn3r.cze View Post
    when i try to compile any source codes using
    Code:
    gcc sourcefile.cpp -o compiledfile
    i always get this error
    Code:
    cpp: error trying to exec 'cc1plus': execvp: No such file or directory
    what does it mean?
    I just encountered this problem. What fixed it for me was to rename my source file from xxx.C to xxx.c. Apparently gcc does not recognize capital C as the same as lowercase c for the file name extension.

  8. #7
    Quote Originally Posted by Runn3r.cze View Post
    when i try to run the compiled file, i get an other error... permission denied.
    show us the command and what it outputs. everything.

    don't make us beg for every scrap of info.


    Quote Originally Posted by Runn3r.cze View Post
    the permissions are 777
    the permissions should NEVER EVER be 777!
    WHAT else is WRONG on your system?
    Tapatalk: Kill it with fire!
    How to ask smart questions | Don't be a Help Vampire | How to Use Code Tags
    You can post a link by removing "http://www." from it.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •