// creating the object
if(event.button.button==SDL_BUTTON_LEFT) bullet myBullet(90, 530, 20, -20, 1);
You're using *automatic* (EDITED, thanks @rip-off. Don't confuse with "auto" C++11 reserved word) declaration -> allocation on the variable "myBullet". That means (among other things) that the "myBullet" timelife remains in the scope in which that variable was declared, in this case, the precedent if statement. When the if statement is consumed, all the *automatic* resources inside the "if" scope are destroyed, including "myBullet". That is the reason why "myBullet.update()" is undefined, because there's no declaration of "myBullet" in the present scope or an outter scope (When you comment out the first line, myBullet declaration, this is in a outter scope, and therefore works).
What you need to do is using dynamic allocation, something like the solutions presented by the others members.