Expected unqualified-id

I don’t see what’s wrong with this code.
I have it in main.cpp.
{
pre_auton;
int main()
Competition.autonomous(autonomous);
Competition.drivercontrol(usercontrol);
vexcodeInit();
while(1){
vex::task::sleep(100);
}
}
it says at the first bracket “unqualified-id”.

Your brackets look a bit odd.
I don’t know why that top opening bracket is there, it’s not attached to anything. You shouldn’t need it.

int main() is a function declaration, it needs brackets:

int main(){
    //code
}

Finally I don’t think vexcodeInit(); is supposed to be in your main function for the competition template - I’m pretty sure it’s in pre auton in the template.

1 Like