Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Adding Steam API to Linux Template 64bit Tier 2

Years of Service
User Offline
Joined: 16th Dec 2009
Posted: 27th Jul 2018 21:57 Edited at: 27th Jul 2018 22:05
So I took another stab at adding Steam to the Linux Template and was successful this time.

If you haven't already install AGK2 on Linux check out this post first:

Instructions for adding Steam to AGK2 Linux Template (Only tested on 64 bit system):

1> Boot into Linux and make sure Steam is running and you are logged into the account where you paid your Product Submission Fee.

2> Download the steam sdk and extract it into your template folder. It should add a folder called "sdk".

3> Edit MakeFile


INC = -I../../common/include -I../../common -I../interpreter -I../../bullet -I../../bullet/BulletCollision/CollisionShapes


INC = -I./sdk/public/steam -I../../common/include -I../../common -I../interpreter -I../../bullet -I../../bullet/BulletCollision/CollisionShapes


# link the .o files
Executable: | $(OBJS)
$(CC) $(OBJS) -o build/LinuxApp$(ARCH) $(LDFLAGS) -Wl,-Bstatic -lAGKLinux -lglfw3 -Wl,-Bdynamic -lGL -lXt -lX11 -lXxf86vm -lXrandr -lpthread -lXi -lXinerama -lXcursor -lcurl -lopenal -ludev -ldl


# link the .o files
Executable: | $(OBJS)
$(CC) $(OBJS) -L. -v -o build/LinuxApp$(ARCH) $(LDFLAGS) -Wl,-Bstatic -lAGKLinux -lglfw3 -Wl,-Bdynamic -lGL -lXt -lX11 -lXxf86vm -lXrandr -lpthread -lXi -lXinerama -lXcursor -lcurl -lopenal -ludev -ldl -lsteam_api

4>Create a new directory in the template directory named build.

5>Add "" in the template directory and template/build directory. It is located in "sdk\redistributable_bin\linux64"

6>Create a text file called "steam_appid.txt" and type your app id number. Save this file and place it also in: template/build

7> Create a text file called "" in the template/build and add the following text:

# This is a script which runs the SteamworksExample in the Steam runtime

# The program location
TOP=$(cd "${0%/*}" && echo ${PWD})


# Steam sets this environment variable when launching games
if [ "$STEAM_RUNTIME" = "" ]; then
export STEAM_RUNTIME="${TOP}/../../tools/linux/runtime/i386"
export LD_LIBRARY_PATH="${STEAM_RUNTIME}/lib/i386-linux-gnu:${STEAM_RUNTIME}/lib:${STEAM_RUNTIME}/usr/lib/i386-linux-gnu:${STEAM_RUNTIME}/usr/lib:${LD_LIBRARY_PATH}"

# Add the current directory to the library path to pick up

exec "${PROGRAM}" "$@"

# vi: ts=4 sw=4 expandtab

8> open a terminal window in template/build directory and make executable with this command:

chmod +x

9>Edit template.c to the following:

// Includes
#include "template.h"
#include "steam_api.h"
#include <string>

// Namespace
using namespace AGK;
using namespace std;

app App;

bool bResult = false;

void app::Begin(void)
agk::SetVirtualResolution (1024, 768);
agk::SetClearColor( 151,170,204 ); // light blue
bResult = SteamAPI_Init();

int app::Loop (void)
if (bResult)

string sSteamName = SteamFriends()->GetPersonaName();
CSteamID steamId = SteamUser()->GetSteamID();
int iSteamID = steamId.GetAccountID();

else agk:rint("Failed...");

return 0; // return 1 to close app

void app::End (void)

10> Now this altered Linux Template is a Steam Linux Template. After compiling the executable you must use "./" to launch it. The steam overlay will not show up when you start the program. From what I have read, it will show up if launched from steam properly. So this isn't a bug. But I haven't yet tested this.

Good Luck!

Login to post a reply

Server time is: 2019-04-21 21:08:09
Your offset time is: 2019-04-21 21:08:09