The compiler sees ++counter_var;, then notices that counter_var is defined as 0;, so it replaces counter_var with 0;, giving you this:
++0;;
which of course is nonsense. Hence the error.
Macros are evil, though. You really shouldn't use them unless you have no other option. They ignore scope rules, pollute the namespace, and lead to very cryptic errors. A normal variable will work just fine here.
WHYYYYYYY would you want to do that? You already have a variable, use it, what would you gain from using a macro?
And I quote
Macros are evil, though. You really shouldn't use them unless you have no other option. They ignore scope rules, pollute the namespace, and lead to very cryptic errors.