C++ fmt library installation is not working

Most packages and libs don't need to be manually downloaded and installed on Ubuntu. You can install libfmt-dev using the somewhat official "universe" repository using apt.

Run the following commands to install:

sudo add-apt-repository universe
sudo apt update
sudo apt install libfmt-dev

Most of the "build" type packages in the Ubuntu repositories have the "dev" suffix at the end. 9 times out of 10, when you need to install some prerequisite or dependency to build stuff using g++ or C++, these will be the "lib" packages that you need.

To search for available packages, you can use the apt-cache search command like in this example:

apt-cache search libfmt

If you get too many results, you can pipe the command to grep to narrow the results like this:

apt-cache search libfmt | grep dev

or something like this:

apt-cache search fmt | grep 'C+'

or you can use the -i flag with grep so that it is not case sensitive like this:

apt-cache search fmt | grep -i 'c+'