VS2015 result_macros.h problems
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3k
- Forks
- 300
- Avg merge
- 19h 12m
- Merged PRs (30d)
- 1
Description
Dear WIL team,
My VS2015 IDE is:
Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.8.04084
My CL.exe is the default that comes with the above IDE (not sure about the version of C++ it supports), however I know that VS2015 does not seem to offer you the /std option to choose a version of C++, like the VS2017 upwards do.
I am trying to use WIL in my project with:
#include <wil/com.h>
And trying to compile, I get the following all related to result_macros.h:
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(1227): error C2440: 'return': cannot convert from 'initializer list' to 'wil::details::ResultStatus'
1> \packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(1227): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(1231): error C2440: 'return': cannot convert from 'initializer list' to 'wil::details::ResultStatus'
1> \packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(1231): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(1235): error C2440: 'return': cannot convert from 'initializer list' to 'wil::details::ResultStatus'
1> \packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(1235): note: No constructor could take the source type, or constructor overload resolution was ambiguous
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(2035): error C2144: syntax error: 'HRESULT' should be preceded by ';'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(2035): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(2041): error C2144: syntax error: 'HRESULT' should be preceded by ';'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(2041): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(2041): error C2086: 'int wil::details::Translates_last_error_to_HRESULT': redefinition
1> \packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(2035): note: see declaration of 'wil::details::Translates_last_error_to_HRESULT'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3906): error C2988: unrecognizable template declaration/definition
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3906): error C2059: syntax error: '('
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3918): error C2143: syntax error: missing ';' before '{'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3918): error C2447: '{': missing function header (old-style formal list?)
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3926): error C2988: unrecognizable template declaration/definition
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3926): error C2059: syntax error: '('
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3936): error C2143: syntax error: missing ';' before '{'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3936): error C2447: '{': missing function header (old-style formal list?)
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3944): error C2988: unrecognizable template declaration/definition
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3944): error C2143: syntax error: missing ';' before '<'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3944): error C2495: 'ReportFailure_GetLastError': '__declspec(noinline)' can only be applied to function declarations or definitions
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3944): error C3829: standard attribute 'noreturn' may only be applied to functions
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3944): error C2433: 'ReportFailure_GetLastError': 'inline' not permitted on data declarations
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3944): error C2495: 'wil::details::ReportFailure_GetLastError': '__declspec(noinline)' can only be applied to function declarations or definitions
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3944): error C2059: syntax error: '<'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3954): error C2143: syntax error: missing ';' before '{'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3954): error C2447: '{': missing function header (old-style formal list?)
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3964): error C2144: syntax error: 'HRESULT' should be preceded by ';'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3974): error C2144: syntax error: 'HRESULT' should be preceded by ';'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3974): error C2988: unrecognizable template declaration/definition
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3974): error C2143: syntax error: missing ';' before '<'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3985): error C2143: syntax error: missing ';' before '{'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3985): error C2447: '{': missing function header (old-style formal list?)
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3993): error C2988: unrecognizable template declaration/definition
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(3993): error C2059: syntax error: '('
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4005): error C2143: syntax error: missing ';' before '{'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4005): error C2447: '{': missing function header (old-style formal list?)
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4013): error C2988: unrecognizable template declaration/definition
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4013): error C2059: syntax error: '('
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4023): error C2143: syntax error: missing ';' before '{'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4023): error C2447: '{': missing function header (old-style formal list?)
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4065): error C2988: unrecognizable template declaration/definition
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4065): error C2059: syntax error: '('
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4077): error C2143: syntax error: missing ';' before '{'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4077): error C2447: '{': missing function header (old-style formal list?)
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4085): error C2988: unrecognizable template declaration/definition
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4085): error C2059: syntax error: '('
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4095): error C2143: syntax error: missing ';' before '{'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4095): error C2447: '{': missing function header (old-style formal list?)
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4103): error C2988: unrecognizable template declaration/definition
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4103): error C2143: syntax error: missing ';' before '<'
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4103): error C2495: 'ReportFailure_GetLastErrorMsg': '__declspec(noinline)' can only be applied to function declarations or definitions
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4103): error C3829: standard attribute 'noreturn' may only be applied to functions
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4103): error C2433: 'ReportFailure_GetLastErrorMsg': 'inline' not permitted on data declarations
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4103): error C2495: 'wil::details::ReportFailure_GetLastErrorMsg': '__declspec(noinline)' can only be applied to function declarations or definitions
1>\packages\microsoft.windows.implementationlibrary.1.0.220201.1\include\wil\result_macros.h(4103): fatal error C1903: unable to recover from previous error(s); stopping compilation
1> INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\CL.exe'
1> Please choose the Technical Support command on the Visual C++
1> Help menu, or open the Technical Support help file for more information
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Could this be due to a wrong C++ version the compiler supports? My project is somehow old and uses MBCS, I would expect for there to be an issue with WIL using Unicode chars, however none of the above seem to be pointing to anything like that.
Any ideas?
You are my last resort, I haven't been able to find a solution on any of the forums out there.
Thank you very much.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the reported include of wil/com.h with the VS2015 CL.exe compiler, then inspect wil/result_macros.h around the listed lines. Determine whether the failures represent unsupported compiler compatibility or a fixable regression, and document the supported outcome with a reproducible build result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100