vendredi 30 septembre 2022

/usr/bin/ld: cannot find -lstdc++ when trying to statically link

I am trying to compile a simple program statically. I keep getting the following error:

$ g++ -std=c++11 main.cpp -static
  /usr/bin/ld: cannot find -lstdc++
  /usr/bin/ld: cannot find -lm
  /usr/bin/ld: cannot find -lc

I removed pieces of code until I got down to the complete barebones:

int main(int argc, char** argv)
{
    return 0;
}

Googling and looking on here haven't proven fruitful. How can I fix this problem?

Aucun commentaire:

Enregistrer un commentaire