g ++:无法确定要运行哪个汇编程序 [英] g++: as fails to determine which assembler to run
问题描述
今天我想重新编译我的一个项目。
Today I wanted to recompile one of my projects. Compiling this project had already worked on my machine, but this time an error occured.
编译器输出结果如下:
fatal error: as: unknown host architecture (can't determine which assembler to run)`
:
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I../../.vscode -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I../../.vscode -I. -o Main.o ../../Main.cpp
我试图编译一些其他项目,但是意识到,我不能使用任何c ++编译器编译任何东西,所以我查找它。
I tried to compile some other projects, but realized, that I wouldn't be able to compile anything using any c++ compiler, so I looked it up.
我发现的唯一的适配线程是这一个,但解决方案'重新安装binutils'没有为我工作(尝试 sudo apt-get install --reinstall binutils
以及 - 重新安装gcc
, g ++
和
build-essential
)
The only fitting thread I found was this one but the solution 'reinstalling binutils' didn't work for me (tried sudo apt-get install --reinstall binutils
as well as --reinstall gcc
, g++
and build-essential
)
这个问题的一个可能原因是我安装的iOS工具链昨天 - 我不得不安装一些不同的clang版本 - 但实际上没有改变任何系统的汇编程序...
One possible reason for this problem that comes to my mind is the iOS-toolchain I installed yesterday - I had to install some different clang versions - but I actually didn't change anything on the system's assembler...
如果有人的一个主意;任何帮助将感激:)
If someone's got an idea; any help would be appreciated :)
Ubuntu 16.04 LTS 64位
Ubuntu 16.04 LTS 64bit
AMD FX(tm)-6300六核处理器×6
AMD FX(tm)-6300 Six-Core Processor × 6
uname -m
返回 x86_64
gcc -march=native -v -E - 2>&1 <<<'' | grep "cc1" | egrep -o -e $'-m(arch|tune)=[^ "\']+'
返回 -march = bdver2
和 -mtune = bdver2
已尝试 gcc [...] -march
与 bdver2
和其他架构
g ++ -v -c HelloWorld.cpp
给我: http://pastebin.com/Ks2be0hL
类型-a as
说:
as is /usr/local/bin/as
as is /usr/bin/as
as --version
可惜只是再次显示错误, $ c> info as 告诉我 binutils-2.26.1-system
从2016-08-07
as --version
sadly just show's me the error again, but info as
tells me it's binutils-2.26.1-system
from 2016-08-07
dpkg -S / usr / bin / as
打印: binutils: usr / bin / as
推荐答案
c $ c>表示
as
是 / usr / local / bin / as
。这是gcc正在运行的,不是 / usr / bin / as
,因为 / usr / local / bin / as
在您的 $ PATH
搜索顺序中首先找到。这是为什么重新安装软件包等没有效果:您安装的其他任何东西(可能手动)安装了一个非标准的作为
。
type -a as
says as
is /usr/local/bin/as
. This is what gcc is running, not /usr/bin/as
, because /usr/local/bin/as
is found first in your $PATH
search order. This is why re-installing packages and so on is having no effect: something else you installed (probably manually) installed a non-standard as
.
看看 / usr / local / bin / as
,找出它来自哪里,以及如何处理它。现在你可以把它重命名为 as.unknown
或者什么,然后一切都将使用正常的系统汇编程序( / usr / bin / as
)。
Have a look at /usr/local/bin/as
and figure out where it came from, and what to do with it. For now you can just rename it to as.unknown
or something, and then everything will use the normal system assembler (/usr/bin/as
).
这篇关于g ++:无法确定要运行哪个汇编程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!