Just use std::max in <algorithm>. Avoid #defining macros. They lead to all sorts of problems.
To actually answer your question... this macro:
cout<<getMax1(a,b);
gets expanded to this:
cout << a>b?a:b ; (spaced added for clarity)
Note that the the << operator has the highest precedence of all those operators, so it is evaluated first.
So it's kind of like:
(cout << a) > b?a:b;
So you end up outputting a to cout, and then trying to compare the result (cout) with b, which doesn't make any sense, which is why the compiler complains.
getMax2 doesn't have that problem because the entire macro is encased in parenthesis... so cout<<getMax2(a,b) expands to cout << ((a)>(b)?(a):(b)) and the parenthesis ensure the > and ?: operators are evaluated first, then then the result is send to cout afterwards.