Compile error: g++: error trying to exec 'cc1plus': execvp: No such file or directory
You need to install gcc-c++
package.
yum install gcc-c++
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
The routine commands that saved me time after time for such errors:
sudo apt update
sudo apt upgrade
sudo apt install gcc python3-dev python3-pip libxml2-dev libxslt1-dev zlib1g-dev g++
Hope it works.
gcc without full path: error trying to exec 'cc1': execvp: No such file or directory
I solved this problem with simple solution.
export PATH
After this command, compile with relative path will be succeed.
Roads to found this:
- I test if add PATH to libexec can compile.
$ PATH=${PATH}:/usr/libexec/gcc/i686-test-linux/8.3.0/
-> Successful
According to strace log, I think gcc does not use $PATH to search cc1/cc1plus. Why?
- I test if PATH to /usr/bin can compile. (by mistake)
$ PATH=${PATH}:/usr/bin
-> Successful
- Why this success? I think PATH already contains "/usr/bin"
$ echo ${PATH}
/sbin:/usr/sbin:/bin:/usr/bin
- I test if passed $PATH simply.
$ PATH=${PATH} gcc
-> Successful
- What the difference between
$ gcc
and$ PATH=$PATH gcc
???
$ set
HOME='/'
HOSTNAME='TEST0'
IFS='
'
LINENO=''
OLDPWD='/'
OPTIND='1'
PATH='/sbin:/usr/sbin:/bin:/usr/bin'
PPID='2701'
PS1='\w \$ '
PS2='> '
PS4='+ '
PWD='/'
SHLVL='8'
TERM='linux'
$ export
export HOME='/'
export OLDPWD='/'
export PWD='/'
export SHLVL='8'
export TERM='linux'
Oh, PATH is not exported as environment variables. only existed as shell variables...
Android ndk-r8 error trying to exec 'cc1plus': execvp: No such file or directory
I have experienced same error.
I was not able to execute even 'gcc, g++' command. So I have googled a lot to find solution, but nothing helped for me.
Then, I found that some filename in ndk is not correct, with tailing _
on some filename.. (In my case, in toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/arm-linux-androideabi/bin folder, there are gcc_
, g++_
, c++_
instead of gcc
, g++
, c++
.)
I used The unarchiver to extract NDK archive, so I think there are something wrong with unarchiving procedure.
So I re-downloaded NDK and checked MD5 checksum, then extracted archive using Mac's default archive utility.
Now, the problem has solved.
Related Topics
iOS Push Notification Does Not Work When Using Crontab Scheduler
Using '$This' in an Anonymous Function in PHP Pre 5.4.0
Get the Metadata of an Order Item in Woocommerce 3
How to Redirect a 404 Error in a Custom 404 Page Using Codeigniter
Post Arrays Not Showing Unchecked Checkboxes
Unit Testing with Items That Need to Send Headers
PHP Replaces Spaces with Underscores
How to Get the Value from Object(Stdclass)
MySQL Table Does Not Exist Error, But It Does Exist
Registry Design Pattern...Good or Bad
Ios7 - Receipts Not Validating at Sandbox - Error 21002 (Java.Lang.Illegalargumentexception)
Laravel Eloquent Sort by Relationship
Sending Data Using Post in Python to PHP
Laravel Error: Method Illuminate\View\View::_Tostring() Must Not Throw an Exception