12

Whenever I try to compile c/cpp files it gives this error:

gcc: fatal error: cannot execute ‘as’: execvp: No such file or directory
compilation terminated.

I have also tried to include full path of file while compiling but same error occured. Just to be sure of version mismatch I looked for both gcc and g++ version but both are same, gcc/g++ version: 9.1.0.

How can I fix this?

Skippy le Grand Gourou
  • 6,976
  • 4
  • 60
  • 76
Sankalp
  • 153
  • 1
  • 2
  • 9

2 Answers2

22

as command is from binutils. Have you installed this package?

Skippy le Grand Gourou
  • 6,976
  • 4
  • 60
  • 76
Mr Pang
  • 1,083
  • 1
  • 8
  • 20
1

The problem seems to be gcc not being able to locate as - the GNU assembler. Try locating it in /usr/bin/as that where it should be. If that is where it exists, the order of your $PATH variables might be the issue. Can you output the $PATH.

OVERLORD
  • 11
  • 4