Closed OPNA2608 closed 3 years ago
These were the first hxcpp externs I wrote so looking back on them now there are a lot of questionable things going on and I'm not sure the request stuff ever worked (probably never tested it since you had to be an accepted discord developer). It should now compile fine on haxe and hxcpp 4.2, though requests still won't work.
Not sure if there was a reason why I got rid of the precompiled headers define but if thats needed for one of your things I've bought it back since I don't think anyone else is using this library.
Works fine for me now, many thanks!
I'm building this with Haxe 4.2 & hxcpp 4.1.15 (updating it to 4.2.1 didn't seem to make a difference) on Linux, as a dependency of Friday Night Funkin'.
As observed in issue https://github.com/ninjamuffin99/Funkin/issues/625#issuecomment-805144241,
#include <hxcpp.h>
is failing because the build process generated a precompiled header file instead.Reintroducing the
NO_PRECOMPILED_HEADERS
variable from https://github.com/Aidan63/linc_discord-rpc/commit/06437161d1f27856a2f3a1e64e33d7aebb2c968c fixes this problem.After this, the compilation fails for me with
I don't program in Haxe but I could get the compilation to succees by changing these method signatures https://github.com/Aidan63/linc_discord-rpc/blob/c4d93cd037bc168e5398048db60b1cc26f61c452/discord_rpc/DiscordRpc.hx#L46 https://github.com/Aidan63/linc_discord-rpc/blob/c4d93cd037bc168e5398048db60b1cc26f61c452/discord_rpc/DiscordRpc.hx#L192 to
ConstPointer<JoinRequest>->Void
and the method call in https://github.com/Aidan63/linc_discord-rpc/blob/c4d93cd037bc168e5398048db60b1cc26f61c452/discord_rpc/DiscordRpc.hx#L161 toDiscordRpc.onRequest(ptr);
. Since the game doesn't use theonRequest
method this works good enough for me, but I would appreciate if someone who actually knows what they're doing either verifies the fix or provides a better one :sweat_smile:.