Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error C2039: “SetDefaultDllDirectories”:is not a member of global namespace

Tags:

mfc

xxx\vc\atlmfc\include\atlcore.h(638): error C2039: “SetDefaultDllDirectories”: is not a member of "global namespace"

#ifndef _USING_V110_SDK71_
    // the LOAD_LIBRARY_SEARCH_SYSTEM32 flag for LoadLibraryExW is only supported if the DLL-preload fixes are installed, so
    // use LoadLibraryExW only if SetDefaultDllDirectories is available (only on Win8, or with KB2533623 on Vista and Win7)...
    IFDYNAMICGETCACHEDFUNCTION(L"kernel32.dll", SetDefaultDllDirectories, pfSetDefaultDllDirectories)
    {
        return(::LoadLibraryExW(pszLibrary, NULL, LOAD_LIBRARY_SEARCH_SYSTEM32));
    }
#endif

the functions in it are all not realized by VS
so how do I solve this problem?
is there something wrong with the libray?I run this program in VS2012

like image 995
Sparta_why Avatar asked May 22 '13 18:05

Sparta_why


2 Answers

Changing the order of Include Directories and included SDK folder works for me: $(IncludePath);C:\Program Files x86\Microsoft SDKs\Windows\v7.1A\Include

If I put folder C:\Program Files %28x86%29\Microsoft SDKs\Windows\v7.1A\Include before $(IncludePath), I will get this error.

like image 51
sky Avatar answered Oct 16 '22 06:10

sky


I also met this issue on VS 2012.

This is caused because you are using the Windows SDK 7.1 which lacks of SetDefaultDllDirectories function call in VS 2012 (VC11). You may notice there is #ifndef _USING_V110_SDK71_ guarded flag to avoid using undefined SetDefaultDllDirectories.

Just define _USING_V110_SDK71_ in your project to let SDK knows you are in this toolset or upgrade to higher version of SDK.

like image 32
Chen OT Avatar answered Oct 16 '22 05:10

Chen OT