Have you written your code in stages?
That is;
Have you written code just to control a motor?
Have you written code just to read the buttons?
If you have written this code all at once and it won't compile.
Can I suggest you write it in stages and prove each stage before attempting to combine them.