0
I would like to know how to install new modules in C++. For example, I recently discovered that there is a module that has an application of the method format
of strings very similar to the method of the same name in python (here the link for the module). It turns out that I have not been successful in importing this module. Below is a replicable example of my error:
#include <iostream> //Já tem
#include <string> // Já tem
#include <fmt/format.h> // Preciso instalar. Como??
using namespace std;
int main(){
string firstname = "Carlos";
string secondname = "Drummond";
string thirdname = "de Andrade";
cout<<fmt::format("{} {} {} foi um grande poeta nascido em Itabira ", firstname, secondname, thirdname)<< endl;
return 0;
}
I searched a little and saw that for these external modules to work I need to have on my computer a folder with extension files lib
and h
. It seems that these files are in the module repository on Github, so I downloaded all the files from the repository and tried to run the program, but I was unsuccessful. So I have two doubts:
- I need to specify the
path
for the module to be activated? If so, how do I do this? - There is a less "manual" way of doing this (in other words, there is something similar to the
pip install
python?
Ever tried to do an env on linux, and see if sudo apt?
– FourZeroFive
env you say is a
virtual environment'
? In relation tosudo apt
you are asking if there is a way to install with this command? Well, I searched and did not find asudo apt
for this package. But this is usually how it is done? As if I were installing any program on my PC?– Lucas