Game Development Community

Error: non-lvalue in unary

by Jon Law · in Torque Game Engine · 04/20/2006 (12:24 pm) · 1 replies

After trying to implement dreamers rpg enhancment kit i get the following error:

error: non-lvalue in unary '&'

bool OpenGLDevice::setVerticalSync( bool on )
{
   // Apple has an internal vsync flag:
   if (platState.ctx)
   {
      return(GL_FALSE != aglSetInteger((AGLContext)platState.ctx, AGL_SWAP_INTERVAL, & (GLint)on));
   }
   return(false);
}

The problem it in here. what exactly does this error mean?
thanks

#1
04/20/2006 (2:06 pm)
Looks like the code is wrong.

due to your order of operations the compiler has made a mistake with what you want the & to mean.

try this:

return(GL_FALSE != aglSetInteger((AGLContext)platState.ctx, AGL_SWAP_INTERVAL, (GLint*)&on));