Vscode-cpptools: <typeinfo> must be included before typeid is used

Created on 8 Oct 2018  Â·  2Comments  Â·  Source: microsoft/vscode-cpptools

  • GCC: MinGW-W64 7.3.0
  • IntelliSenseMode: gcc-x64
#include <typeinfo>
#include <iostream>

int main() {
    const std::type_info &info = typeid(int); //<typeinfo> must be included before typeid is used
}

Relative: #1067

Language Service bug fixed (release pending)

All 2 comments

This error occurs when the typeinfo class can't be found (the "must be included" message is misleading).

One workaround should be to add " -fno-ms-extensions" to end of your compilerPath.

I think we should change the default mode for mingw back to the -fno-ms-extensions, because -fms-extensions causes more problems than it solves.

Was this page helpful?
0 / 5 - 0 ratings