It’s currently almost 23:15, and I’m already sleepy. Therefore, this is going to be a short note on how I fixed an minor but annoying issue nvim-treesiter (Neovim’s plugin) on openSUSE Leap (15.5).

The error message is or was as below:

nvim-treesitter[yaml]: Error during compilation
cc: error trying to exec 'cc1plus': execvp: No such file or directory
Press ENTER or type command to continue

I don’t code in C++ nowadays, but the error looks like the C or C++ compiler was missing. But first, let’s show the version of openSUSE running on this instance, I mean VM:

❯ cat /etc/os-release
NAME="openSUSE Leap"
ID_LIKE="suse opensuse"
PRETTY_NAME="openSUSE Leap 15.5"

According to this forum post [1], my VM is missing a package called gcc-c++. Let’s verify that too:

thounchey2:~ # rpm -qi gcc-c++
package gcc-c++ is not installed

Right, let’s install this package with zypper:

thounchey2:~ # zypper install gcc-c++
Retrieving repository 'Update repository of openSUSE Backports' metadata ...................[done]
Building repository 'Update repository of openSUSE Backports' cache ........................[done]
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following 3 NEW packages are going to be installed:
  gcc-c++ gcc7-c++ libstdc++6-devel-gcc7

  3 new packages to install.
  Overall download size: 15.6 MiB. Already cached: 0 B. After the operation, additional 59.7 MiB will be used.
  Continue? [y/n/v/...? shows all options] (y): y

Once neovim was restarted, the error message complaining “cc: error trying to exec cc1plus:…” has magically disappeared.