I find your logic dubious here. You're searching for libraries to link to; isn't searching for dll files not only useless, but potentially harmful if they're found instead of the ones you wanted?