mardi 3 octobre 2023

"identifier "unordered_map" is undefined" error in VS Code C++ (on Ubuntu Linux)

#include <bits/stdc++.h>

int main()
{
    std::unordered_map<int, int> test{};

    test[2] = 14;

    std::cout << test[2];
}

Errors:

  • identifier "unordered_map" is undefined
  • type name is not allowed
  • identifier "test" is undefined

I test the code in VS Code C++ on Ubuntu Linux and I can't compile it (It works fine in an online compiler). Why do I have these errors and how to fix them?

Aucun commentaire:

Enregistrer un commentaire