This error occurs because each file includes the other, a potentially tricky situation. You need forward declarations. Try putting class card; just before class deck { in deck.h and class deck; just before class card { in card.h.
EDIT: As Disch has pointed out, you don't actually need to include deck.h in your case since you are only referencing deck as a friend. See his excellent article on the subject in the articles section.