Vscode-cpptools: C++ could not read tuple header file

Created on 28 Sep 2020  路  3Comments  路  Source: microsoft/vscode-cpptools

  • OS Version: macOS Catalina version. 10.15.6
  • VS Code Version: 1.49.0
  • C/C++ Extension Version: 1.0.1
  • Other extensions you installed (and if the issue persists after disabling them): Code Runner
  • Does this issue involve using SSH remote to run the extension on a remote machine?: No

Steps to reproduce

  1. Include header file "tuple" in .cpp file.
  2. Initialize tuple Object in main() function and run the source code.

Expected behavior

  1. Does not occur errors and print out the output value(1, 2, 3).
temp3.cpp:9:5: error: no template named 'tuple'
    tuple<int, int, int> tp;
    ^
temp3.cpp:10:10: error: use of undeclared identifier 'make_tuple'
    tp = make_tuple(1, 2, 3);
         ^
2 errors generated.

Screenshots
Screen Shot 2020-09-28 at 1 23 04 PM

external

Most helpful comment

It's also possible your compiler defaults to an older version of the standard. Try adding -std:c++11 to the command line.

All 3 comments

Those errors are not from our extension. They're from the g++ command on your path. It looks like the g++ on your path doesn't support tuple, i.e. maybe a version of g++ older than 6. Can you install a newer version of g++? You can use g++ --version to see the version.

It's also possible your compiler defaults to an older version of the standard. Try adding -std:c++11 to the command line.

Thank you guys for all your support. Will try it.

Was this page helpful?
0 / 5 - 0 ratings