You need to set the port pin tris register for output that you are trying to use as an output. Your message says that you are trying to connect an led to port pin 2 but you are setting port pin 0 as an output. Also you are trying to set the entire port high instead of the individual pin. It should be HIGH GPIO.2
Bookmarks