How do you link an attachment image to a category in Wordpress? I have attempted this, however it does not work.

<a href="<?php get_category_link($cat->cat_ID) ?>"><?php wp_get_attachment_image('thumb'); ?></a>