Add '#pragma comment (lib, "Setupapi.lib")' to your source file.