Hana failed to build with error C2065, error C2977, error C2913... on MSVC
- Dominant language
- C++
- Stars
- 1.9k
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
**Describe**
Hi all,
Hana failed to build with error C2065, error C2977, error C2913... on MSVC on windows. Could you please help look at this issue or provide some workarounds? Thanks in advance.
**Steps to reproduce**
1. open VS2019 x64 tools command
2. git clone https://github.com/boostorg/hana F:\gitP\boostorg\hana
3. cd F:\gitP\boostorg\hana & mkdir build_amd64 & cd F:\gitP\boostorg\hana\build_amd64
4. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DBOOST_ROOT=F:\tools\boost_1_70_0\x64\boost -DBOOST_INCLUDEDIR=F:\tools\boost_1_70_0\x64 -DCMAKE_CXX_FLAGS="/EHsc /Zc:ternary /bigobj" -DBOOST_HANA_ENABLE_STRING_UDL=false ..
5. msbuild /m /p:Platform=x64 /p:Configuration=Release Boost.Hana.sln /t:Rebuild
**log:**
[build (4).log](https://github.com/boostorg/hana/files/10191290/build.4.log)
F:\gitP\boostorg\hana\example\adapt_adt.cpp(38,1): error C2065: 'name': undeclared identifier [F:\gitP\boostorg\hana\build_amd64\example\example.adapt_adt.vcxproj]
F:\gitP\boostorg\hana\example\adapt_adt.cpp(38,1): error C2977: 'boost::hana::accessors_impl': too many template arguments [F:\gitP\boostorg\hana\build_amd64\example\example.adapt_adt.vcxproj]
F:\gitP\boostorg\hana\example\adapt_adt.cpp(41,1): error C2913: explicit specialization; 'boost::hana::accessors_impl' is not a specialization of a class template [F:\gitP\boostorg\hana\build_amd64\example\example.adapt_adt.vcxproj]
F:\gitP\boostorg\hana\include\boost/hana/concept/struct.hpp(26,25): error C3203: 'accessors_impl': unspecialized class template can't be used as a template argument for template parameter 'Method', expected a real type [F:\gitP\boostorg\hana\build_amd64\example\example.adapt_adt.vcxproj]
F:\gitP\boostorg\hana\include\boost/hana/accessors.hpp(33,20): error C2825: 'Accessors': must be a class or namespace when followed by '::' [F:\gitP\boostorg\hana\build_amd64\example\example.adapt_adt.vcxproj]
40>F:\gitP\boostorg\hana\include\boost/hana/accessors.hpp(33,31): error C2510: 'Accessors': left of '::' must be a class/struct/union [F:\gitP\boostorg\hana\build_amd64\example\example.adapt_adt.vcxproj]
40>F:\gitP\boostorg\hana\include\boost/hana/accessors.hpp(33,1): error C3889: call to object of class type 'boost::hana::apply_t': no matching call operator found
**Versions and configuration**
VS version: VS2019(16.11.20)
Operating system: windows server 2019
The commit is 944f717
Contributor guide
Research direction
Reproduce the failure with the listed VS2019, CMake, Boost, and MSBuild commands, then inspect example/adapt_adt.cpp alongside include/boost/hana/concept/struct.hpp and include/boost/hana/accessors.hpp. Compare the reported template errors with the commit 944f717 and verify the result by rebuilding Boost.Hana.sln successfully on the stated configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cmake, cpp
- Domain
- build-system, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100