Solution to `linker` error while building `bat`

I was trying to install bat, from source, the clone of cat command with syntax highlighting and Git integration, in a CentOS machine, via cargo, Rust package installer. But it gave me this error:

error: linker `cc` not found
  |
  = note: No such file or directory (os error 2)

error: aborting due to previous error

error: failed to compile `bat v0.18.2`, intermediate artifacts can be found at `/tmp/cargo-installl9Fzac`

Caused by:
  could not compile `libc`

I was missing linker on the system. To fix it I installed gcc.

yum install gcc

I was also missing libgit2-devel.

Show Comments