Open bababooey1234 opened 1 year ago
Found the issue: the documentation says "struct IDiscordCoreEvents events;", when it should just be "IDiscordCoreEvents events;"
Really weird design choice to not just do the usual:
typedef struct {
// stuff
} Application;
[This way struct
doesn't have to be explicitly stated for variables]
Description
Following the game sdk getting started tutorial at https://discord.com/developers/docs/game-sdk/sdk-starter-guide#code-primer-unreal-engine-c raises the compilation error
error: storage size of 'events' isn't known
The game sdk provides the following snippets for utilising the game sdk library in C:
However, the line
struct IDiscordCoreEvents events;
raises the following compilation error in the TDM64-GCC compiler:error: storage size of 'events' isn't known
This seems to be due to the fact that
struct IDiscordCoreEvents
is defined withtypedef void* IDiscordCoreEvents;
in discord_game_sdk.h, although I'm not sure why that would cause an error, as replacing the line in the code withvoid *events;
seems to work just fine.Steps to Reproduce
main.c:
Compile with:
gcc -Wall -o main.exe -L -l discord_game_sdk.dll main.c
(with discord_game_sdk.dll and discord_game_sdl.dll.lib in same directory as main.c)Expected Behavior
Setup completing without error
Current Behavior
error: storage size of 'events' isn't known
Screenshots/Videos
No response
Client and System Information
Compiler: TDM64-GCC version 10.3.0
OS: Microsoft Windows 11 Home Version 10.0.22621 Build 22621