Find the answer to your Linux question:
Results 1 to 5 of 5
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 ...
  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,114
    Try installing g++

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    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++'.
    DISTRO=Arch
    Registered Linux User #388732

  4. #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?

  5. #5
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Run the command:
    Code:
    ls -l compiledfile
    and tell us the output.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

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