Skip to content

error when use the default preLaunchTask configuration and c++17. #111100

@Tudyx

Description

@Tudyx
  • VSCode Version: 1.51.1
  • OS Version: ubuntu 20.04.1 LTS

Steps to Reproduce:

  1. Create a simple c++ file that use a c++17 feature
  2. Terminal > Configure Default Build Task
  3. Choose C/C++: g++ build active file.
  4. add flag "-std=c++17" in args of tasks.json.
    Then the build work with Terminal > Run Build Task
  5. Run > Add Configuration... and then choose C++ (GDB/LLDB).
  6. Choose g++ build and debug active file.
  7. Run > Start Debugging
    Then the build task don't work anymore : error in terminal saying than he don't find c++17 feature, for instance "error: ‘optional’ is not a member of ‘std’".

When i applied this 2 modification i able to build and run with Run > Start Debugging :

  1. change in launch.json the "preLaunchTask" from "C/C++: g++ build active file" to "foo"
  2. change in tasks.json the "label" from "C/C++: g++ build active file" to "foo"

My cpp file :

#include <iostream>
#include <optional>
int main() {
    std::optional<std::string> data; 
    std::cout << "Hello World!";
    return 0;
}

Does this issue occur when all extensions are disabled?: Yes/No

Metadata

Metadata

Assignees

No one assigned

    Labels

    *caused-by-extensionIssue identified to be caused by an extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions