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

Build error C2061: syntax error: identifier 'BOOST_SCOPED_ENUM' on Windows MSVC #779

Closed
moyoumiu opened this issue Dec 8, 2023 · 1 comment · Fixed by #783
Closed

Build error C2061: syntax error: identifier 'BOOST_SCOPED_ENUM' on Windows MSVC #779

moyoumiu opened this issue Dec 8, 2023 · 1 comment · Fixed by #783

Comments

@moyoumiu
Copy link

moyoumiu commented Dec 8, 2023

Desc

Boost.Spirit failed build with "error C2061: syntax error: identifier 'BOOST_SCOPED_ENUM' " on Windows MSVC.

Info

  • Boost.Spirit 59515f0 (Boost ad09f66)
  • Windows 11 10.0.22621
  • Visual Studio 17.8.2

Reproduce Steps

Open x64 Native Tools Command Prompt for VS 2022

git clone --recursive --depth=1 https://github.com/boostorg/boost.git
cd boost
bootstrap
b2 headers variant=release --build-dir=out\amd64rel address-model=64
b2 variant=release --build-dir=out\amd64rel address-model=64
:: build Boost.Spirit
:: b2 variant=release --build-dir=out\amd64rel libs\spirit\test address-model=64
:: or the command
cl.exe -Zm800 -nologo "libs\spirit\test\karma\binary1.cpp" -c -TP -wd4675 -EHs -GR -Zc:throwingNew -O2 -Ob2 -W3 -MD -Zc:forScope -Zc:wchar_t -Zc:inline -Gw -favor:blend -wd4244 -wd4365 -wd4459 -D"BOOST_ALL_NO_LIB=1" -D"BOOST_BIND_DETAIL_REQUIRES_CXX11_HPP_INCLUDED" -D"BOOST_COBALT_USE_STD_PMR=1" -D"BOOST_ENDIAN_DETAIL_REQUIRES_CXX11_HPP_INCLUDED" -D"BOOST_FUNCTION_DETAIL_REQUIRES_CXX11_HPP_INCLUDED" -D"BOOST_HASH_DETAIL_REQUIRES_CXX11_HPP_INCLUDED" -D"BOOST_SMART_PTR_DETAIL_REQUIRES_CXX11_HPP_INCLUDED" -D"BOOST_SYSTEM_DETAIL_REQUIRES_CXX11_HPP_INCLUDED" -D"BOOST_TYPEOF_DETAIL_REQUIRES_CXX11_HPP_INCLUDED" -D"BOOST_UNORDERED_DETAIL_REQUIRES_CXX11_HPP_INCLUDED" -D"NDEBUG" -I"." -I"libs\spirit\test\karma"

Error

binary1.cpp
.\boost/spirit/home/karma/binary/binary.hpp(197): error C2061: syntax error: identifier 'BOOST_SCOPED_ENUM'
.\boost/spirit/home/karma/binary/binary.hpp(198): error C2913: explicit specialization; 'boost::spirit::karma::detail::what' is not a specialization of a class template
.\boost/spirit/home/karma/binary/binary.hpp(207): error C2913: explicit specialization; 'boost::spirit::karma::detail::what' is not a specialization of a class template
.\boost/spirit/home/karma/binary/binary.hpp(216): error C2913: explicit specialization; 'boost::spirit::karma::detail::what' is not a specialization of a class template
.\boost/spirit/home/karma/binary/binary.hpp(220): error C2061: syntax error: identifier 'BOOST_SCOPED_ENUM'
.\boost/spirit/home/karma/binary/binary.hpp(222): error C2882: 'endian': illegal use of namespace identifier in expression
.\boost/spirit/home/karma/binary/binary.hpp(222): note: the template instantiation context (the oldest one first) is
.\boost/spirit/home/karma/binary/binary.hpp(280): note: see reference to class template instantiation 'boost::spirit::karma::any_binary_generator<T>' being compiled
.\boost/spirit/home/karma/binary/binary.hpp(222): error C2065: 'bits': undeclared identifier
.\boost/spirit/home/karma/binary/binary.hpp(222): error C2977: 'boost::spirit::karma::any_binary_generator': too many template arguments
.\boost/spirit/home/karma/binary/binary.hpp(222): note: see declaration of 'boost::spirit::karma::any_binary_generator'
.\boost/spirit/home/karma/binary/binary.hpp(222): error C3203: 'any_binary_generator': unspecialized class template can't be used as a template argument for template parameter 'Derived', expected a real type
...
@Kojoley
Copy link
Collaborator

Kojoley commented Feb 23, 2024

Fixed by #783

@Kojoley Kojoley closed this as completed Feb 23, 2024
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

Successfully merging a pull request may close this issue.

2 participants