Search code examples
c++linker-errorssteamunreal-engine4steamworks-api

SteamFriends unresolved external symbol


I have been following the Steamworks documentation to a T, but I am running into linker errors.

I know that the API is installed correctly and imported correctly, because I can include any steam header file and it finds it properly, and when I run my game, the Steam overlay shows up.

However, I recently tried to access the community part of the API, particularly to get the user's friends. According to the documentation, you are to use the SteamFriends() symbol for that.

I have included steam_api.h, steam_gameserver.h, isteamfriends.h, and isteamutils.h in my accessing object's header, and I have also added the steam_api.dll and steam_api.lib to my project, but no dice.

Every time, I get the following error:

error LNK2019: unresolved external symbol _imp_SteamFriends

Has anyone successfully done this?


Additional Info:

  • Unreal Engine Version: 4.7.5
  • Steam API Version: 1.32
  • Platform: PC
  • IDE: Visual Studio 2013 Professional

Solution

  • After scrounging the internet for any documentation, I found the problem.

    Epic expects you to link all libraries and perform all includes that you need manually.

    This meant that I had to add the directory where all of the steam_api.lib, steam_api64.lib, etc files were stored to the configuration, and then I needed to link it in the actual files using

    #pragma comment(lib, "win64/steam_api64")
    

    So on a side note, they need help with their documentation; that was way harder to figure out than it should be.