views:

38

answers:

2

Hello, I'm trying to enumerate files through the Windos 7 library API, e.g. with SHLoadLibraryFromKnownFolder

I'm using a C++ win32 console application and getting link errors, e.g.,

Error LNK2019: unresolved external symbol __imp__DSA_DestroyCallback@12 referenced in function "void __cdecl DSA_DestroyCallback(struct _DSA *,int (__stdcall*)(void const *,void *),void *)" (?DSA_DestroyCallback@@YAXPAU_DSA@@P6GHPBXPAX@Z2@Z)

These errors appear even if I only #include <ShlObj.h>

Should I add some specific library to the linker inputs? Thanks, R.

+6  A: 

The documentation for DSA_DestroyCallback states that you need to link against Comctl32.lib.

James McNellis
How dare you beat me! +1
Billy ONeal
It links, thanks. Then at runtime I get an error "the ordinal 346 could not be located in the dynamic link library CMCTL32.dll"
robi
@robi: you probably have a version mismatch.
sixlettervariables
A: 

The linker can't find DSA_DestroyCallback. That function is in Comctl32.lib. Did you include that import library?

(Add #pragma comment(lib, "comctl32.lib") if you are on MSVC)

Billy ONeal