Difficulty installing mongoc and mongocxx drivers for mongodb

I’m following this guide: Getting Started with MongoDB and C++ | MongoDB

I’ve downloaded and extracted the tarball for both the mongo-c and mongo-cxx drivers, but when I get to the “Execute build” part under step 1 for installing the C driver, my terminal spits out a bunch of errors and I’ve been unable to figure out what the problem is. I’ve looked at a bunch of other topics on various forums and websites on related errors but none of them are what I’m actually experiencing, so their solutions have done nothing for me so far. Below is the terminal output where you can see me extract the tarball, build with cmake, and then attempt to install with cmake: