I am programming a DirectX Game and on Debug mode it's working normally,
but on release mode I get 46 Errors of this:
Severity Code Description Project File Line Suppression State Error C2039 'CheckForDuplicateEntries': is not a member of 'Microsoft::WRL::Details' DirectXGame D:\Windows Kits\10\Include\10.0.17763.0\winrt\wrl\module.h 1427
I looked into the module.h code and saw this code:
void VerifyEntries() throw()
{
// Walk the linker generated list of pointers to CreatorMap for WinRT objects
for (const Details::CreatorMap** entry = GetMidEntryPointer() + 1; entry < GetLastEntryPointer(); entry++)
{
if (*entry == nullptr)
{
continue;
}
const wchar_t* name = ((*entry)->activationId.getRuntimeName)();
(name);
// Make sure that runtime class name is not nullptr and it has no empty string
__WRL_ASSERT__(name != nullptr && ::wcslen(name) != 0);
}
Details::CheckForDuplicateEntries((GetFirstEntryPointer() + 1), GetMidEntryPointer(),
[](const Details::CreatorMap* entry, const Details::CreatorMap* entry2) -> void {
__WRL_ASSERT__(entry->activationId.clsid != entry2->activationId.clsid && "Duplicate CLSID!");
}
);
Details::CheckForDuplicateEntries((GetMidEntryPointer() + 1), GetLastEntryPointer(),
[](const Details::CreatorMap* entry, const Details::CreatorMap* entry2) -> void {
__WRL_ASSERT__(::wcscmp((entry->activationId.getRuntimeName)(), (entry2->activationId.getRuntimeName)()) != 0 && "Duplicate runtime class name!");
}
);
}
But CheckForDuplicateEntries is only allowed on Debug mode:
#ifdef _DEBUG
template<typename T>
inline void CheckForDuplicateEntries(const CreatorMap** firstEntry, const CreatorMap** lastEntry, T validateEntry) throw()
{
__WRL_ASSERT__(firstEntry <= lastEntry);
if (firstEntry == lastEntry)
{
return;
}
for (const CreatorMap** entry = firstEntry; entry < (lastEntry - 1); entry++)
{
if (*entry == nullptr)
{
continue;
}
// Walk the linker generated list of pointers to CreatorMap
for (const CreatorMap** entry2 = (entry + 1); entry2 < lastEntry; entry2++)
{
if (*entry2 != nullptr)
{
(validateEntry)(*entry, *entry2);
}
}
}
}
#endif // _DEBUG
Does anyone know how I can get rid of this error?
I tried to remove the #endif define and of course it worked but only in visual studio and no where else.
I'm using vs2019, iso c++ 17, SDK 10.0.17763.0,
Thank you for helping!
SOLUTION: Updated SDK version from 10.0.17763.0 to 10.0.20348.0