Reputation: 1791
I am on a 64 bit Windows 11 Professional system running 64 bit Visual Studio 2022 version 17.2.5 Community Edition.
I am working on a project which uses boost asio and beast (version 1_79_0) which does not compile regardless whether the "C++ Language Standard" property set to /std:c++14 or /std:c++17 or /std:c++20 or /std:c++latest (preview).
Both Visual Studio and Boost are "fresh installs". Is this a known incompatibility or is there some other project property or preprocessor macro that I need to set?
1>E:\boost_1_79_0\boost\date_time\wrapping_int.hpp(40,28): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\wrapping_int.hpp(40,28): error C2062: type 'int' unexpected
1>E:\boost_1_79_0\boost\date_time\wrapping_int.hpp(88): message : see reference to class template instantiation 'boost::date_time::wrapping_int<int_type_,wrap_val>' being compiled
1>E:\boost_1_79_0\boost\date_time\wrapping_int.hpp(40,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>E:\boost_1_79_0\boost\date_time\wrapping_int.hpp(114,28): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\wrapping_int.hpp(114,28): error C2062: type 'int' unexpected
1>E:\boost_1_79_0\boost\date_time\wrapping_int.hpp(161): message : see reference to class template instantiation 'boost::date_time::wrapping_int2<int_type_,wrap_min,wrap_max>' being compiled
1>E:\boost_1_79_0\boost\date_time\wrapping_int.hpp(114,1): error C2334: unexpected token(s) preceding '{'; skipping apparent function body
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(84,33): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(111,33): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): error C2760: syntax error: '*' was unexpected here; expected 'id-expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(116): message : see reference to class template instantiation 'boost::date_time::month_functor<date_type>' being compiled
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): error C2760: syntax error: '*' was unexpected here; expected 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): error C3878: syntax error: unexpected token '*' following 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): message : error recovery skipped: '*'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): error C2760: syntax error: ')' was unexpected here; expected ';'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): error C3878: syntax error: unexpected token ')' following 'expression_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): message : error recovery skipped: ')'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): error C2760: syntax error: ')' was unexpected here; expected 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(75,75): message : error recovery skipped: ') ) ) . . . )'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C2760: syntax error: '*' was unexpected here; expected 'id-expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C3878: syntax error: unexpected token '(' following 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): message : error recovery skipped: '( ( int . . . *'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C2760: syntax error: ')' was unexpected here; expected ';'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C3878: syntax error: unexpected token ')' following 'jump_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C3878: syntax error: unexpected token ')' following 'statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C3878: syntax error: unexpected token ')' following 'statement_seq'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): message : missing one of: '}' ?
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C2760: syntax error: ')' was unexpected here; expected '}'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C3878: syntax error: unexpected token ')' following 'compound_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C3878: syntax error: unexpected token ')' following 'selection_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): message : error recovery skipped: ')'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C2760: syntax error: ')' was unexpected here; expected 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): error C3878: syntax error: unexpected token ')' following 'expression_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,35): message : error recovery skipped: ') ) ,'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,67): error C2760: syntax error: ')' was unexpected here; expected ';'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,67): error C3878: syntax error: unexpected token ')' following 'expression_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(78,67): message : error recovery skipped: ')'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): error C2760: syntax error: '*' was unexpected here; expected 'id-expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): error C2760: syntax error: '*' was unexpected here; expected 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): error C3878: syntax error: unexpected token '*' following 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): message : error recovery skipped: '*'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): error C2760: syntax error: ')' was unexpected here; expected ';'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): error C3878: syntax error: unexpected token ')' following 'expression_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): message : error recovery skipped: ')'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): error C2760: syntax error: ')' was unexpected here; expected 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(102,75): message : error recovery skipped: ') ) ) . . . )'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C2760: syntax error: '*' was unexpected here; expected 'id-expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C3878: syntax error: unexpected token '(' following 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): message : error recovery skipped: '( ( int . . . *'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C2760: syntax error: ')' was unexpected here; expected ';'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C3878: syntax error: unexpected token ')' following 'jump_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C3878: syntax error: unexpected token ')' following 'statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C3878: syntax error: unexpected token ')' following 'statement_seq'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): message : missing one of: '}' ?
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C2760: syntax error: ')' was unexpected here; expected '}'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C3878: syntax error: unexpected token ')' following 'compound_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C3878: syntax error: unexpected token ')' following 'selection_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): message : error recovery skipped: ')'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C2760: syntax error: ')' was unexpected here; expected 'expression'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): error C3878: syntax error: unexpected token ')' following 'expression_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,35): message : error recovery skipped: ') ) ,'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,67): error C2760: syntax error: ')' was unexpected here; expected ';'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,67): error C3878: syntax error: unexpected token ')' following 'expression_statement'
1>E:\boost_1_79_0\boost\date_time\adjust_functors.hpp(105,67): message : error recovery skipped: ')'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): warning C4003: not enough arguments for function-like macro invocation 'as_int'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): error C2760: syntax error: '*' was unexpected here; expected 'id-expression'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(221): message : see reference to class template instantiation 'boost::date_time::split_timedate_system<config>' being compiled
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): error C3878: syntax error: unexpected token '(' following 'expression'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): message : error recovery skipped: '( ( int . . . *'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): error C2760: syntax error: ')' was unexpected here; expected ';'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): error C3878: syntax error: unexpected token ')' following 'jump_statement'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): message : error recovery skipped: ')'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): error C2760: syntax error: ')' was unexpected here; expected 'expression'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): error C3878: syntax error: unexpected token ')' following 'expression_statement'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(185,64): message : error recovery skipped: ') ) ) . . . )'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): error C2760: syntax error: '*' was unexpected here; expected 'id-expression'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): error C3878: syntax error: unexpected token '(' following 'expression'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): message : error recovery skipped: '( ( int . . . *'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): error C2760: syntax error: ')' was unexpected here; expected ';'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): error C3878: syntax error: unexpected token ')' following 'jump_statement'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): message : error recovery skipped: ')'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): error C2760: syntax error: ')' was unexpected here; expected 'expression'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): error C3878: syntax error: unexpected token ')' following 'expression_statement'
1>E:\boost_1_79_0\boost\date_time\time_system_split.hpp(203,64): message : error recovery skipped: ') ) ) . . . )'
This 2.5 years old SO question provides a solution to include concepts but I do not know where to include the preprocessor directive.
Understandably if you browse all the way down on the Release Notes of boost version_1_79_0 then under Compilers Tested->Windows: the last version is 14.2 which is Visual Studio 2019 since Visual Studio 2022 was not stably released at that time.
I've have been a C# dev and C++ is not my forte (first timer) therefore any directions on solving this has to be detailed.
Thank you in advance for your time.
Upvotes: 0
Views: 573
Reputation: 1791
The order of the includes was the culprit.
I was using boost asio and boost beast with another c++ framework and once I moved those includes all the way down the boost errors disappeared.
I had also opened an issue with boost library on github, closed that issue as well.
Hope it helps people with similar issues.
Bonus Tip
I have started using cpr library in place of boost beast. Saves me a lot of heartaches.
Upvotes: 1