diff --git a/helpers/pe_helpers/pe_helpers.hpp b/helpers/pe_helpers/pe_helpers.hpp index b8c14ec8..0f1a028c 100644 --- a/helpers/pe_helpers/pe_helpers.hpp +++ b/helpers/pe_helpers/pe_helpers.hpp @@ -6,6 +6,7 @@ #include #include +#include namespace pe_helpers { diff --git a/premake5.lua b/premake5.lua index 56b34a67..1e1c84a5 100644 --- a/premake5.lua +++ b/premake5.lua @@ -345,7 +345,6 @@ filter { "action:vs*", } -- source of emittoolversioninfo: https://developercommunity.visualstudio.com/t/add-linker-option-to-strip-rich-stamp-from-exe-hea/740443 "/NOLOGO", "/emittoolversioninfo:no" } - -- GNU make common compiler/linker options filter { "action:gmake*", } buildoptions { @@ -359,11 +358,24 @@ filter { "action:gmake*" , "files:*.cpp or *.cc or *.hpp", } buildoptions { "-fno-char8_t", -- GCC gives a warning when a .c file is compiled with this } --- MinGw on Windows cannot compile 'creatwth.cpp' from Detours lib (error: 'DWordMult' was not declared in this scope) --- because intsafe.h isn't included by default +-- MinGw on Windows common compiler/linker options filter { "system:windows", "action:gmake*", } buildoptions { - "-include intsafe.h" + -- MinGw on Windows cannot compile 'creatwth.cpp' from Detours lib (error: 'DWordMult' was not declared in this scope) + -- because intsafe.h isn't included by default + "-include intsafe.h", + } + -- source: https://gcc.gnu.org/onlinedocs/gcc/Cygwin-and-MinGW-Options.html + linkoptions { + -- MinGW on Windows cannot link wWinMain by default + "-municode", + -- from docs: "specifies that the typical Microsoft Windows predefined macros are to be set in the pre-processor, + -- but does not influence the choice of runtime library/startup code" + -- optional really + '-mwin32', + } +filter { "system:windows", "action:gmake*", "platforms:x64" } + buildoptions { } filter {} -- reset the filter and remove all active keywords diff --git a/tools/steamclient_loader/win/ColdClientLoader.cpp b/tools/steamclient_loader/win/ColdClientLoader.cpp index e2845d76..9ff7136d 100644 --- a/tools/steamclient_loader/win/ColdClientLoader.cpp +++ b/tools/steamclient_loader/win/ColdClientLoader.cpp @@ -15,6 +15,7 @@ #include #include #include +#include static std::wstring IniFile{}; @@ -60,7 +61,7 @@ std::wstring get_ini_value(LPCWSTR section, LPCWSTR key, LPCWSTR default_val = N static std::vector get_pe_header(const std::wstring &filepath) { try { - std::ifstream file(filepath, std::ios::binary); + std::ifstream file(std::filesystem::path(filepath), std::ios::binary); if (!file.is_open()) throw; file.seekg(0, std::ios::beg);