gamesdk-and-dispatch icon indicating copy to clipboard operation
gamesdk-and-dispatch copied to clipboard

SDK fails to compile with GCC 11.1 due to missing include

Open RealFloorIsJava opened this issue 4 years ago • 0 comments

This time in the correct tracker ;-)

Description

SDK cpp files fail to compile due to missing include in some environments.

Analysis below.

Steps to Reproduce

Attempt to compile the code.

Expected Behavior

SDK files compile

Current Behavior

In file included from /home/snip/snap/snip/src/plugins/discordpresence/discord/achievement_manager.h:3,
                 from /home/snip/snap/snip/src/plugins/discordpresence/discord/achievement_manager.cpp:5:
/home/snip/snap/snip/src/plugins/discordpresence/discord/types.h:167:23: error: ‘int64_t’ in namespace ‘std’ does not name a type
  167 | using ClientId = std::int64_t;

Screenshots/Videos

N/A

Client and System Information

Arch Linux w/ GCC 11.1. Latest SDK.

Analysis and fix

The sdk uses fixed width integer types (FWIT) from the std namespace but only includes stdint.h. In order to obtain the FWIT inside std, the standard compliant way is to include <cstdint>.

See https://en.cppreference.com/w/cpp/types/integer

RealFloorIsJava avatar Nov 25 '21 17:11 RealFloorIsJava