0

So I have this error: Error 1 error LNK2019: unresolved external symbol _imp_StrRetToBufW@16 referenced in function _wmain

I include:

 #include "stdafx.h"
 #include <shlobj.h>
 #include <shlwapi.h>
 #include <iostream>

and I call the function like this:

 StrRetToBuf(&strDispName, pidlItems, pszDisplayName, MAX_PATH);

So there is a linker error. Any fixes?

AlexandruC
  • 3,527
  • 6
  • 51
  • 80

2 Answers2

1

You should link your project with Shlwapi.lib. It is the import library for the DLL where StrRetToBuf resides in.

Andriy
  • 8,486
  • 3
  • 27
  • 51
1

The reference page for StrRetToBuf() states that you must link with Shlwapi.lib.

hmjd
  • 120,187
  • 20
  • 207
  • 252