You really should follow the instructions, word for word, try the photovore demo, then modify from there.
All the errors you are getting are because you strayed from the instructions.
Start off with something that works, then make small modifications and finally compile. Its easy to debug small modifications, but not a large program all at once. Compile often as you write your code, to keep debugging manageable.