Accessing Steam functions in c++

I am new to C++.
I am trying to acess the steam api in my c++ code project, but whenever I try to include any of the steam_api.h or other files involving it, I am given more errors than I can make sense of.
I would like to be able to call functions such as SteamUserStats()->SetAchievement( "AllLevelsComplete" ); in my code, but I assume that would require some manner of include statements. The confusing part for me in all of this is I have steamworks already tied into my game, the overlay appears, the game shows as playing online in steam.

So how would I achieve what I feel is already achieved in many senses of the word in my game, but with my own control in c++?

It kind of sound like you need to add module depency to build script to use those functions, can you paste those ompile errors?

Ah wait you mean Steam online services, i remind myself you need to place steam sdk files in to UE4 in order to use it (dont know exacly which) due to licence issues.

Hi Spiris.

You should not directly get steam online subsystem. Instead of that UE4 provide general interface to working with OnlineSubsystems such like Steam, GameCenter (IOS), GooglePlay, etc. To get this interface try this:

#include "OnlineSubsystem.h"
auto pOnlineSubsystem = IOnlineSubsystem::Get();

To set up achievement progress use this function

pOnlineSubsystem ->GetAchievementsInterface()->WriteAchievements(…);

Hope it helps!

How would you access the Steam Stats (Not leaderboard stats) through the OnlineSubsystem?

I seem to have met the same problem as you,I want to use authentication function of steamwork, what’s new?