Compile error: “g++: error trying to exec 'cc1plus': execvp: No such file or directory”

后端 未结 9 1659
情深已故
情深已故 2020-12-04 20:52

When I compile C/C++ program with popen in php... I got this error:

g++: error trying to exec \'cc1plus\': execvp: No such file or          


        
9条回答
  •  情深已故
    2020-12-04 21:24

    I had the same issue with gcc "gnat1" and it was due to the path being wrong. Gnat1 was on version 4.6 but I was executing version 4.8.1, which I had installed. As a temporary solution, I copied gnat1 from 4.6 and pasted under the 4.8.1 folder.

    The path to gcc on my computer is /usr/lib/gcc/i686-linux-gnu/

    You can find the path by using the find command:

    find /usr -name "gnat1"
    

    In your case you would look for cc1plus:

    find /usr -name "cc1plus"
    

    Of course, this is a quick solution and a more solid answer would be fixing the broken path.

提交回复
热议问题