void declaration error
You forgot to put the parenthenses () after the name of the function changelights. They are there to declare variables you can use later in the code like that:
void function(int a){
  a+=1;
  return a;
}

To fix your error just change
void changelights{

to
void changelights(){

Keep in mind if you want to program C++ (which would be Off-Topic here, but you mentioned it in your question) you have to declare the function in the beginning or mention it.