Skip to content

"error C2039: 'back_inserter': is not a member of 'std'" when building #207

Closed

Description

Brief description of your issue

Cannot build all the projects

Steps to reproduce

1- Clone the repo
2- Open the solution in Visual Studio
3- Build for Release/x64

Expected behavior

All the projects should be built.

Actual behavior

Compilation Errors:

Errors:
1>------ Build started: Project: AppInstallerCommonCore, Configuration: Release x64 ------
1>pch.cpp
1>D:\cpp\winget-cli\src\AppInstallerCommonCore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(1246,50): error C2039: 'back_inserter': is not a member of 'std'
1>D:\cpp\winget-cli\src\AppInstallerCommonCore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(692): message : see declaration of 'std'
1>D:\cpp\winget-cli\src\AppInstallerCommonCore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(1246,50): message : This diagnostic occurred in the compiler generated function 'void winrt::vector_base<D,T>::assign(InputIt,InputIt)'
1>D:\cpp\winget-cli\src\AppInstallerCommonCore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(1252): message : see reference to class template instantiation 'winrt::vector_base<D,T>' being compiled
1>D:\cpp\winget-cli\src\AppInstallerCommonCore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(2618,63): error C2039: 'back_inserter': is not a member of 'std'
1>D:\cpp\winget-cli\src\AppInstallerCommonCore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(692): message : see declaration of 'std'
1>D:\cpp\winget-cli\src\AppInstallerCommonCore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(2701): message : see reference to class template instantiation 'winrt::impl::convertible_observable_vector<T,Container>' being compiled
1>Done building project "AppInstallerCommonCore.vcxproj" -- FAILED.
2>------ Build started: Project: AppInstallerCLICore, Configuration: Release x64 ------
2>pch.cpp
2>D:\cpp\winget-cli\src\AppInstallerCLICore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(1246,50): error C2039: 'back_inserter': is not a member of 'std'
2>D:\cpp\winget-cli\src\AppInstallerCLICore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(692): message : see declaration of 'std'
2>D:\cpp\winget-cli\src\AppInstallerCLICore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(1246,50): message : This diagnostic occurred in the compiler generated function 'void winrt::vector_base<D,T>::assign(InputIt,InputIt)'
2>D:\cpp\winget-cli\src\AppInstallerCLICore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(1252): message : see reference to class template instantiation 'winrt::vector_base<D,T>' being compiled
2>D:\cpp\winget-cli\src\AppInstallerCLICore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(2618,63): error C2039: 'back_inserter': is not a member of 'std'
2>D:\cpp\winget-cli\src\AppInstallerCLICore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(692): message : see declaration of 'std'
2>D:\cpp\winget-cli\src\AppInstallerCLICore\x64\Release\Generated Files\winrt\Windows.Foundation.Collections.h(2701): message : see reference to class template instantiation 'winrt::impl::convertible_observable_vector<T,Container>' being compiled
2>Done building project "AppInstallerCLICore.vcxproj" -- FAILED.
3>------ Build started: Project: AppInstallerCLI, Configuration: Release x64 ------
3>LINK : fatal error LNK1181: cannot open input file 'D:\cpp\winget-cli\src\x64\Release\AppInstallerCommonCore\AppInstallerCommonCore.lib'
3>Done building project "AppInstallerCLI.vcxproj" -- FAILED.
4>------ Build started: Project: AppInstallerCLIPackage, Configuration: Release x64 ------
4>LINK : fatal error LNK1181: cannot open input file 'D:\cpp\winget-cli\src\x64\Release\AppInstallerCommonCore\AppInstallerCommonCore.lib'
4>Done building project "AppInstallerCLI.vcxproj" -- FAILED.
========== Build: 0 succeeded, 4 failed, 2 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 0 failed, 0 skipped ==========

Environment

Windows SDK: 10.0.18362.0
Visual Studio: Microsoft Visual Studio Enterprise 2019 Preview Version 16.7.0 Preview 1.0
Platform Toolset: Visual Studio 2019 (v142)
Windows Version: 2004 (19628.1)

Activity

  1. added
    Issue-Bug
    on May 20, 2020
  2. JohnMcPMS commented on May 20, 2020

    @JohnMcPMS
    Member

    This is very odd, no idea why its happening. The only thing that comes to mind is updating our C++/WinRT reference.

  3. added this to the milestone on May 23, 2020
  4. denelon commented on Apr 20, 2021

    @denelon
    Collaborator

    Ahmed Yarub Hani Al Nuaimi (@ahmedalnuaimi) are you still having problems building this project?

  5. added
    Needs-Author-Feedback
    on Apr 20, 2021
  6. ahmedalnuaimi commented on Apr 20, 2021

    @ahmedalnuaimi
    Author

    Ahmed Yarub Hani Al Nuaimi (@ahmedalnuaimi) are you still having problems building this project?

    I've just tested the master branch with the latest Visual Studio 2019 Preview version and it worked!

  7. ghost added
    Needs-Attention
    on Apr 20, 2021
  8. ghost removed
    Needs-Author-Feedback
    on Apr 20, 2021
  9. modified the milestones: , v1.0 - Windows Package Manager on May 4, 2021
  10. removed
    Needs-Attention
    on Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Issue-Bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions