ryanjon2040/Discord-UE4

Compile errors with latest SDK

mastercoms opened this issue · 5 comments

I am installing the plugin in engine source 4.25, and creating a build of it.

Compile errors
Module.DiscordUE4.cpp
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winnt.h(603): warning C4005: 'TEXT': macro redefinition
10:37:16
    D:\ue\Engine\Source\Runtime\Core\Public\HAL/Platform.h(1034): note: see previous definition of 'TEXT'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10229): error C4668: '_WIN32_WINNT_WIN10_TH2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10235): error C4668: '_WIN32_WINNT_WIN10_RS1' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10240): error C4668: '_WIN32_WINNT_WIN10_TH2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10244): error C4668: '_WIN32_WINNT_WIN10_TH2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10251): error C4668: '_WIN32_WINNT_WIN10_RS2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10261): error C4668: '_WIN32_WINNT_WIN10_RS2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10265): error C4668: '_WIN32_WINNT_WIN10_TH2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10270): error C4668: '_WIN32_WINNT_WIN10_RS3' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10277): error C4668: '_WIN32_WINNT_WIN10_RS4' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10280): error C4668: '_WIN32_WINNT_WIN10_RS1' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10283): error C4668: '_WIN32_WINNT_WIN10_RS4' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10288): error C4668: '_WIN32_WINNT_WIN10_RS1' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10291): error C4668: '_WIN32_WINNT_WIN10_RS5' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10486): error C4668: '_WIN32_WINNT_WIN10_RS2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(10510): error C4668: '_WIN32_WINNT_WIN10_RS5' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(13950): error C4668: '_WIN32_WINNT_WIN10_RS5' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(15111): error C4668: '_WIN32_WINNT_WIN10_RS3' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(15128): error C4668: '_WIN32_WINNT_WIN10_RS3' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(15147): error C4668: '_WIN32_WINNT_WIN10_RS2' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(15266): error C4668: '_WIN32_WINNT_WIN10_RS3' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(15416): error C4668: '_WIN32_WINNT_WIN10_RS4' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(15429): error C4668: '_WIN32_WINNT_WIN10_RS4' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\um\winioctl.h(15657): error C4668: '_WIN32_WINNT_WIN10_RS1' is not defined as a preprocessor macro, replacing with '0' for '#if/#elif'
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(24): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(35): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(46): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(67): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(78): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(169): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(180): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(191): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(202): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(233): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(254): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(265): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(276): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(307): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(318): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(329): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(470): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(591): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(662): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(693): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(724): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
10:37:16
    D:/ue/Engine/Plugins/ProjectBorealis/Discord-UE4/Source/DiscordUE4/discord-files/types.cpp(765): warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.

After modifying the plugin structure quite a bit, I managed to fix these errors, but unfortunately, Core.h from Unreal Engine is included instead of core.h from Discord Game SDK.

same error here

I will look into this.

@mastercoms @jackylee0424 Found the problem. To fix it, follow these steps:

1: Open ffi.h and replace

#include <Windows.h>

with this:

#include "Runtime/Core/Public/Windows/AllowWindowsPlatformTypes.h"
#include "Runtime/Core/Public/Windows/MinWindows.h"
#include "Runtime/Core/Public/Windows/HideWindowsPlatformTypes.h"

2: Open types.h and remove #include <Windows.h>

Both files can be found under discord-files folder.

Thanks! Will this be added to the documentation? If not, I can close the issue.

Yes I'll add this to the documentation. Closing this issue now.

@mastercoms Added to documentation.