Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to build autowiring with /std:c++17 + msvc + windows #1051

Closed
PhoebeHui opened this issue Mar 2, 2018 · 4 comments · Fixed by #1056
Closed

Failed to build autowiring with /std:c++17 + msvc + windows #1051

PhoebeHui opened this issue Mar 2, 2018 · 4 comments · Fixed by #1056
Labels

Comments

@PhoebeHui
Copy link

Build Autowiring with /std:c++17 with Visual studio 2017(version 15.5.7) on windows failed with following failures, could you help have a look?

D:\Autowiring\src\src.\autowiring/C++11/filesystem.h(20): error C2874: using-declaration causes a multiple declaration of 'std::experimental::filesystem::v1::path' [D:\Autowiring\build_x86\src\autowiring\test\AutowiringTest.vcxproj]
D:\Autowiring\src\src.\autowiring/C++11/filesystem.h(26): error C2874: using-declaration causes a multiple declaration of 'std::experimental::filesystem::v1::filesystem_error' [D:\Autowiring\build_x86\src\autowiring\test\AutowiringTest.vcxproj]

@jdonald jdonald added the bug label Mar 12, 2018
@jdonald
Copy link
Contributor

jdonald commented Mar 12, 2018

Hi @PhoebeHui,

#1055 adds various fixes for /std:c++17. However, we were never able to reproduce your std::experimental issue, having tested VS2017 versions 15.6.1, 15.5.7, and earlier. Is it possible you had other local changes that inadvertently caused multiple using statements?

Please let us know if the problem persists.

@CaseyCarter
Copy link

The "15.5.7" in the report is misleading: this is actually a problem in the next (as-yet-unreleased) preview of 15.7. C++11/filesystem.h declares several entities in std::filesystem which clash with entities that the Microsoft standard library defines in std::filesystem in that next release. We're reporting the problem before we break you to give you a head start.

@jdonald
Copy link
Contributor

jdonald commented Mar 20, 2018

@CaseyCarter that makes sense. Thanks for the heads-up.

I'm looking to #ifdef out this code for future Visual Studio releases. However, _MSC_VER seems to be still set to 1913 (same as version 15.6) in 15.7.0 Preview 1.0. Is that going to be bumped to 1914 or is there some other proper way to detect whether the built-in std::filesystem is available?

@CaseyCarter
Copy link

I "strongly suspect" that 15.7 Preview 2 will define _MSC_VER to 1914. (I can never tell which prerelease details are ok to disclose. I may get fired, but helping to fix your bugs is just that important to us here at Microsoft.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants