I had a similar issue and I found that the problem was I used a single '=' instead of a double '==' in an if statement
lvalue error:
if (n = 100) { code } // this is incorrect and comes back with the lvalue error
correct:
if (n == 100) { code } // this resolved my issue