Unresolved Externals when using Steam_api.h

Hey,

just wanted to test the Steamworks thing. I can see the overlay when playing and i don’t get errors until i want to use something from the API.

I read that i have to use SteamAPI_Init() first, but this gives me Unresolved Externals.
I setup Steamworks with Ramas tutorial and included the steam_api.h found in the thirdparty folder i filled earlier with the tutorial.

What am i doing wrong? o.o

Error	6	error LNK2019: unresolved external symbol __imp_SteamAPI_IsSteamRunning referenced in function "public: virtual void __cdecl AMyCharacter::BeginPlay(void)" (?BeginPlay@AMyCharacter@@UEAAXXZ)	C:\Users\Cedric\Documents\Unreal Projects\SteamNetworkTest\Intermediate\ProjectFiles\MyCharacter.cpp.obj	SteamNetworkTest

I am unfamiliar with that function, and did not use it when I integrated the Steam overlay myself.
What I had to do to enable the Steam overlay, was add a few lines in my DefaultEngine.ini, as well as add three lines in my game’s Build.cs

I had to add the following lines to Config/DefaultEngine.ini:

[Engine.GameEngine]
+NetDriverDefinitions=(DefName="GameNetDriver",DriverClassName="OnlineSubsystemSteam.SteamNetDriver",DriverClassNameFallback="OnlineSubsystem.IpNetDriver")
 
[OnlineSubsystem]
DefaultPlatformService=Steam

[OnlineSubsystemSteam]
bEnabled=true
SteamDevAppId=480

[OnlineSubsystemSteam.SteamNetDriver]
NetConnectionClassName="OnlineSubsystemSteam.SteamNetConnection"

And the following two strings to PublicDependencyModuleNames.AddRange in Build.cs:
“OnlineSubsystem”, “OnlineSubsystemUtils”.

Finally, I had to add: DynamicallyLoadedModuleNames.Add("OnlineSubsystemSteam");

NOTE: The steamoverlay (the API even?) is disabled in the editor, but will work if you release your game.

I had this already setup. I missed adding the steam_api.lib file. That wasn’t added to Ramas tutorial. Now i can work with the API.
The “SteamAPI_Init()” is for working with the API. This was said in the Documentation from Valve.

The API is disabled in editor, yes, you/i would need to recompile the engine and delete a specific line that checks, if the Game is run in Editor.
Adding -game to the Debug Commands is fixing it for testing.

So, my answer to this is quite easy. I needed to link the library. Didn’t know that was necessary since it wasn’t mention in the Tutorial from Rama. Maybe he could add this step.

For others running into this problem: Look up the toturial for adding labraries to the build. You will only need to link the library. The includes are up to you.