Pizzabelly / EasyRP

Give yourself a Custom Rich Presence in Discord.
563 stars 153 forks source link

Ninja building fails #151

Closed ghost closed 3 years ago

ghost commented 3 years ago

When running ninja it fails with following error(s):

ninja: Entering directory `build'
[1/2] Compiling C++ object easyrp.exe.p/main.cpp.obj
FAILED: easyrp.exe.p/main.cpp.obj
"c++" "-Ieasyrp.exe.p" "-I." "-I.." "-I..\discord-rpc\include" "-fdiagnostics-color=always" "-DNDEBUG" "-pipe" "-D_FILE_OFFSET_BITS=64" "-Wall" "-Winvalid-pch" "-Wnon-virtual-dtor" "-Wextra" "-Wpedantic" "-std=c++14" "-O3" -MD -MQ easyrp.exe.p/main.cpp.obj -MF "easyrp.exe.p\main.cpp.obj.d" -o easyrp.exe.p/main.cpp.obj "-c" ../main.cpp
../main.cpp: In function 'int main()':
../main.cpp:32:14: error: 'std::this_thread' has not been declared
   32 |         std::this_thread::sleep_for(std::chrono::seconds(1));
      |              ^~~~~~~~~~~
ninja: build stopped: subcommand failed.

I didn't change any of the code, I am using gcc through MinGW as compiler. It works flawless on linux but I need to edit the config file extension from .ini to .txt and I need it on windows. So building on linux isn't an option.

ghost commented 3 years ago

Ended up bytepatching, I found out that appearantly gcc doesn't properly support threads or something simiar. Closing this issue because it's more of a user issue. If anyone wants to patch the file extension from ini to txt aswell, here is a small py scrip to do so.

with open("EasyRP.exe", "rb+") as fh:
    data = fh.read()
    offset = data.find(b"\x69\x6e\x69")
    fh.seek(offset)
    fh.write(b"\x74\x78\x74")