I am trying to use Steamworks SDK and compile it on linux, so I dont have to run it on a more resource intensive windows machine.
To do anything in steamworks you need to use a function SteamAPI_Init()
which fails spectacularly when compiling. The below headers, and g++ command are the minimum effective samples of what I am using to try to do this.
#include <unistd.h>
#pragma comment(lib, "libsteam_api.so")
#include "./sdk/public/steam/steam_api.h"
#include <iostream>
#include <stdlib.h>
int main(){
return SteamAPI_Init();
}
g++ -L./ -llibsteam_api.so File.cpp -o output_file
-> throws error cannot find -llibsteam_api.so
g++ File.cpp -o output_file
-> (below error)
/usr/bin/ld: /tmp/cc1ozUAl.o: in function `main':
file.cpp:(.text+0x9): undefined reference to `SteamAPI_Init'
collect2: error: ld returned 1 exit status
This compiles just fine on windows (if I change the top 2 lines to be the windows equivalent header and library). I suspect that this has to do with the library that I am trying to use, its a 64 bit version but does the same with the 32 bit version. Otherwise I might be missing some dependency that I couldn't find in the docs
How can I get this to compile properly?