Search code examples
c++steamunreal-engine4steamworks-api

Importing Steam Community API in Unreal Engine


So I have my Steamworks SDK imported in my Unreal Engine project. It builds, and on run, I get the Steam overlay. Great!

However, I am now trying to get the user's friends list, which requires the Steam Community API, which is included in two files, ISteamFriends.h and ISteamUtils.h. I am trying to import those into an Actor class that I created to manage Steam communication, but Visual Studio doesn't see the files and won't build.

#include "GameFramework/Actor.h"
#include "Http.h"
#include "ISteamFriends.h"
#include "ISteamUtils.h"
#include "SteamEvents.generated.h"
...

This produces the errors:

error C1083: Cannot open include file 'ISteamFriends.h': No such file or directory

error C1083: Cannot open include file 'ISteamUtils.h': No such file or directory

Is there a specific directory path that I need to give it so that it can find these files? How can I get Visual Studio to find these files so that I can use the Community API?


Solution

  • Make sure that the directories needed to compile the project (additional includes) are set in the project properties. This can vary depending on the version of Visual Studio, usually is located in Configuration Properties > C/C++ / General as depicted in the following image:

    enter image description here

    Also be careful to do the same for static libraries if any (.lib files); the additional include directories for those are in the Linker Section.