If you can run the program without an error but can not start with full compile that means you have an error in a block of code that has not been called when you ran the program.

Variable not defined means exactly that. You are trying to use a variable that is either not defined or not defined within the scope where it is used.

The error should have shown you where the error is and it should be a simple matter to determine which variable it is referring to