bash 尝试执行“as”时出错:execvp:没有这样的文件或目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10274468/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-18 02:06:56  来源:igfitidea点击:

error trying to exec 'as': execvp: No such file or directory

bashgcccygwinmingw-w64

提问by Steven Penny

When trying to build I get this error:

尝试构建时出现此错误:

$ make CC=i686-w64-mingw32-gcc
  CC    aes.c
i686-w64-mingw32-gcc: error trying to exec 'as': execvp: No such file or directory

回答by Steven Penny

Set PATHto /usr/bininstead of /bin

设置PATH/usr/bin而不是/bin

There is a known caveat where calling the compiler directly as /bin/x86_64-w64-mingw32-gccwill fail, use /usr/bin/x86_64-w64-mingw32-gccinstead and make sure that your PATHvariable has /usr/binbefore /bin.

有一个已知的警告,直接调用编译器 /bin/x86_64-w64-mingw32-gcc会失败,请 /usr/bin/x86_64-w64-mingw32-gcc改用并确保您的PATH变量/usr/bin/bin.

mingw-w64.sourceforge.net

mingw-w64.sourceforge.net

This is caused by a mounting problem. On linux you have /binand /usr/bin, no big deal. On Cygwin you have C:\cygwin\bin. Then mount points are set like this.

这是由安装问题引起的。在 linux 上,你有/bin/usr/bin,没什么大不了的。在 Cygwin 上,您有C:\cygwin\bin. 然后像这样设置挂载点。

C:\cygwin\bin on /usr/bin
C:\cygwin on /

So technically you could represent C:\cygwin\binwith /binor /usr/bin, although as stated above the former will not work.

因此,从技术上讲,您可以C:\cygwin\bin/bin或表示/usr/bin,尽管如上所述,前者不起作用。

回答by Eugen Konkov

You probably miss g++for mingw.

你可能错过g++mingw

Try this:

尝试这个:

sudo apt install g++-mingw-w64-i686

After that either i686-w64-mingw32-gccor i686-w64-mingw32-g++will compile your sources.

之后,i686-w64-mingw32-gcc或者i686-w64-mingw32-g++将编译您的源代码。