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

Hana failed to build with error C2065, error C2977, error C2913... on MSVC #512

Open
fangzhouxia opened this issue Dec 9, 2022 · 2 comments

Comments

@fangzhouxia
Copy link

fangzhouxia commented Dec 9, 2022

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
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

@wilhelm-now
Copy link

With Visual Studio 17 2022 17.4.4 I've made boost-hana from boost 1.81 dependent projects build with adding compile options /Zc:__cplusplus and /Zc:preprocessor. This got rid of the accessors_impl related warnings.

I still have some trouble building all of the git repo.

@ldionne
Copy link
Member

ldionne commented Mar 13, 2023

Can you try again now? I think that is likely fixed by ff423df.

I don't have access to a Windows machine handy.

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

No branches or pull requests

3 participants