Icons are resources so you need to add the compiled resource file (.res, created from .rc) containing the icon to the link line.