In C language the grammar and the semantics of the conditional operator is different from C++. Your code would compile in C++, since in C++ the expression
<condition> ? a = b : c = d
would be parsed as
<condition> ? (a = b) : (c = d)
In C the same expression is parsed as
(<condition> ? (a = b) : c) = d
which is a completely different story. The result of ?:
in C is never an lvalue, which is why the latter parsing does not compile.
Your code suffers from exactly the same error.
More pedantically, as Johannes noted in the comments, the ?:
is not eligible to serve as the left-hand side of the assignment operator for reasons that have nothing to do with lvalues or rvalues. The grammar simply immediately disallows it. The expression is not supposed to be parsable at all. However, judging by the error message you quoted, your compiler sees the problem differently (or at least reports it in a way that can be seen as "mildly misleading").
This is one of the rather well-known differences between C and C++ languages:
Errors using ternary operator in c
Conditional operator differences between C and C++