Reputation: 161
My program uses the PathFileExistsW
function from shlwapi.h
:
#include <shlwapi.h>
int main() {
LPCWSTR folderName = L"";
PathFileExistsW(folderName);
}
If I compile it, I get the following linker error. How to solve it.?
Example.obj : error LNK2019: unresolved external symbol __imp_PathFileExistsW
referenced in function main
Upvotes: 5
Views: 15707
Reputation: 161
Adding a comment lib
pragma anywhere in the .cpp solves the linker error:
#pragma comment(lib, "Shlwapi.lib")
Upvotes: 4
Reputation: 5168
Add shlwapi.lib to your dependency list:
Configuration Properties -> Linker -> Input -> Additional Dependencies
Upvotes: 11
Reputation: 3339
First you need to add VC++ directories Then you need to set linker input.
Upvotes: 0