Terminal: Large number of "'function' is not a member of 'std'" errors

Created on 7 May 2019  路  18Comments  路  Source: microsoft/terminal

I just cloned this repo per the instructions, and opened OpenConsole.sln in __VS 2019__, restored the nuget packages, and ran "Build Solution", and I'm getting hundreds of errors. They seem to stem from most projects failing with errors like the below:

Severity Code Description Project File Line Suppression State Error C2039 'function': is not a member of 'std' RendererBase C:\src\github\Terminal\src\buffer\out\textBuffer.hpp 146

Doing the suggested quickfix of adding #include <functional> seems to clear the errors on the first few I tried, but this is so endemic it would take a while to fix everywhere. Perhaps it was the upgrade to VS 2019 using different default settings from VS 2017?

Most helpful comment

If you're trying to build on VS19, add #include <functional> below #include <filesystem> in LibraryIncludes.h

All 18 comments

Was able to reproduce on VS2019 Community as well. In addition I was getting a lot of other errors as well, Including some:

Severity    Code    Description Project File    Line    Suppression State
Error   C2039   'function': is not a member of 'std' (compiling source file ..\GlyphWidth.cpp)  Types   C:\Users\gotos\source\repos\Terminal\src\types\inc\CodepointWidthDetector.hpp   124 
Error   C2143   syntax error: missing ';' before '<' (compiling source file ..\GlyphWidth.cpp)  Types   C:\Users\gotos\source\repos\Terminal\src\types\inc\CodepointWidthDetector.hpp   124 
Error   C4430   missing type specifier - int assumed. Note: C++ does not support default-int (compiling source file ..\GlyphWidth.cpp)  Types   C:\Users\gotos\source\repos\Terminal\src\types\inc\CodepointWidthDetector.hpp   124 
Error   C2238   unexpected token(s) preceding ';' (compiling source file ..\GlyphWidth.cpp) Types   C:\Users\gotos\source\repos\Terminal\src\types\inc\CodepointWidthDetector.hpp   124 
Error   C2039   'function': is not a member of 'std' (compiling source file ..\GlyphWidth.cpp)  Types   C:\Users\gotos\source\repos\Terminal\src\types\inc\GlyphWidth.hpp   14  
Error   C2065   'function': undeclared identifier (compiling source file ..\GlyphWidth.cpp) Types   C:\Users\gotos\source\repos\Terminal\src\types\inc\GlyphWidth.hpp   14  
Error   C2275   'std::wstring_view': illegal use of this type as an expression (compiling source file ..\GlyphWidth.cpp)    Types   C:\Users\gotos\source\repos\Terminal\src\types\inc\GlyphWidth.hpp   14  
Error   C2065   'pfnFallback': undeclared identifier (compiling source file ..\GlyphWidth.cpp)  Types   C:\Users\gotos\source\repos\Terminal\src\types\inc\GlyphWidth.hpp   14  
Error   C2182   'SetGlyphWidthFallback': illegal use of type 'void' (compiling source file ..\GlyphWidth.cpp)   Types   C:\Users\gotos\source\repos\Terminal\src\types\inc\GlyphWidth.hpp   14  

VS info

Microsoft Visual Studio Community 2019
Version 16.0.3
VisualStudio.16.Release/16.0.3+28803.352
Microsoft .NET Framework
Version 4.8.03752

Installed Version: Community

Visual C++ 2019   00435-60000-00000-AA561
Microsoft Visual C++ 2019

Application Insights Tools for Visual Studio Package   9.0.20409.1
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2019   16.0.12313.64372
ASP.NET and Web Tools 2019

ASP.NET Web Frameworks and Tools 2019   16.0.12313.64372
For additional information, visit https://www.asp.net/

Azure App Service Tools v3.0.0   16.0.12313.64372
Azure App Service Tools v3.0.0

Azure Functions and Web Jobs Tools   16.0.12313.64372
Azure Functions and Web Jobs Tools

C# Tools   3.0.0-beta4-19218-01+18b0cfb66884840b40491fa0896a8854d68b3959
C# components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Common Azure Tools   1.10
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

DiscordRPCVS Extension   1.0
DiscordRPCVS Visual Studio Extension Detailed Info

GitHub.VisualStudio   2.8.0.6762
A Visual Studio Extension that brings the GitHub Flow into Visual Studio.

JetBrains ReSharper Ultimate 2019.1   Build 191.0.20190429.185145
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright 漏 2019 JetBrains, Inc.

Microsoft Azure Tools   2.9
Microsoft Azure Tools for Microsoft Visual Studio 0x10 - v2.9.0.0

Microsoft Continuous Delivery Tools for Visual Studio   0.4
Simplifying the configuration of Azure DevOps pipelines from within the Visual Studio IDE.

Microsoft JVM Debugger   1.0
Provides support for connecting the Visual Studio debugger to JDWP compatible Java Virtual Machines

Microsoft Library Manager   1.0
Install client-side libraries easily to any web project

Microsoft MI-Based Debugger   1.0
Provides support for connecting Visual Studio to MI compatible debuggers

Microsoft Visual C++ Wizards   1.0
Microsoft Visual C++ Wizards

Microsoft Visual Studio Tools for Containers   1.1
Develop, run, validate your ASP.NET Core applications in the target environment. F5 your application directly into a container with debugging, or CTRL + F5 to edit & refresh your app without having to rebuild the container.

Microsoft Visual Studio VC Package   1.0
Microsoft Visual Studio VC Package

NuGet Package Manager   5.0.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

ProjectServicesPackage Extension   1.0
ProjectServicesPackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

ResourcePackage Extension   1.0
ResourcePackage Visual Studio Extension Detailed Info

SQL Server Data Tools   16.0.61903.25110
Microsoft SQL Server Data Tools

Syntax Visualizer   1.0
An extension for visualizing Roslyn SyntaxTrees.

Test Adapter for Boost.Test   1.0
Enables Visual Studio's testing tools with unit tests written for Boost.Test.  The use terms and Third Party Notices are available in the extension installation directory.

Test Adapter for Google Test   1.0
Enables Visual Studio's testing tools with unit tests written for Google Test.  The use terms and Third Party Notices are available in the extension installation directory.

TypeScript Tools   16.0.10306.2001
TypeScript Tools for Microsoft Visual Studio

Visual Basic Tools   3.0.0-beta4-19218-01+18b0cfb66884840b40491fa0896a8854d68b3959
Visual Basic components used in the IDE. Depending on your project type and settings, a different version of the compiler may be used.

Visual F# Tools 10.4 for F# 4.6   16.0.0.0.  Commit Hash: 809f41207b74a1356208f11b8fa3a15233734050.
Microsoft Visual F# Tools 10.4 for F# 4.6

Visual Studio Code Debug Adapter Host Package   1.0
Interop layer for hosting Visual Studio Code debug adapters in Visual Studio

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for CMake   1.0
Visual Studio Tools for CMake

Visual Studio Tools for Containers   1.0
Visual Studio Tools for Containers

FWIW: I also have VS 2017 on the same machine, and resetting the repo and opening the solution with VS 2017, and everything built fine first attempt - so it definitely appears to be a VS 2019 specific issue.

========== Rebuild All: 47 succeeded, 0 failed, 0 skipped ==========

Yeah, it seems to be a 2019 issue, I get it as well, if you add

include

to the files where you are getting the errors, it should compile.

FYI: also happens if you try using the scripts in /tools directory.

https://github.com/microsoft/Terminal/pull/429#issuecomment-489787763

Would suggest noting for VS users they will need "Universal Windows Platform Development" installed and, for 2019 users, they need to explicitly select the v141 toolset.

Looks like this might be the culprit, Though I'm getting all the errors after installing it.

Project 'Microsoft.UI.Xaml.Markup' could not be loaded because it's missing install components. To fix this launch Visual Studio installer with the following selections: C++ (v142) Universal Windows Platform tools

It's not listed on the VS installer, and I've got the UWP development workload installed; so I have no idea what's actually going on.

EDIT: actually it is under the optional tab of the UWP development workload on the right-hand side; totally missed that. Will try again with it installed soon.

EDIT 2: It did get rid of the toolset errors but the errors above actually still remain. I think... we can disregard my comments 馃槄

I got these errors when Visual Studio tried to build the ARM64 configuration, works fine with x64 both in Visual Studio 2017 and Visual Studio 2019 now. BUT the result is not as pretty as the version demonstrated by Microsoft in todays sessions. The tabs are ugly!!!

The v141 toolset might actually have got me to somewhere, because there's only three warning/errors present now. Trying to get rid of the rest of it...

@johanlindfors how do you make it just do x64?

If you're trying to build on VS19, add #include <functional> below #include <filesystem> in LibraryIncludes.h

449 This should fix it (Thanks @Someguynamedpie)

@will -- msbuild openconsole.sln /p:Platform=x64 should do it. I had the same issue with it using ARM as the default platform.

@oising -- Weird, that didn't fix it for me. I switched it from ARM to x64 (I also tried x86) but the same issue persisted until I added the #include line.

@aaron-sonin Maybe you're on vs2019 -- I stuck with vs2017.

@oising I am, yeah.

See #461

Resolved in #449?

Closing as resolved in #449.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

zadjii-msft picture zadjii-msft  路  3Comments

warpdesign picture warpdesign  路  3Comments

carlos-zamora picture carlos-zamora  路  3Comments

mdtauk picture mdtauk  路  3Comments

mrmlnc picture mrmlnc  路  3Comments