🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Link SteamSDK to G++

Started by
3 comments, last by CavariuX 8 years, 6 months ago

Hello, and Thanks for at least opening the question.

Well, I have being all day trying to link my steamsdk to my project, I'm compiling it with g++ and I understand must of it.

I added the Include with the flag '-Ilibs/steam' and added the flag for the Library Directory '-Llibs/steam', in that folder theirs the header files and 1 folder with the name lib that contains binaries for linux, mac (Im using it but its for XCODE and Im using vim and compiler) and for windows. So they are not useful. Also in the directory 'libs/steam' there is a file that is called 'steam_api.lib' and I have being trying to link it by several ways mostly '-lsteam_api' but it says that there is not library by that name. I also tried to compile my own static library but didn't work.

I will share a screenshot of the folders and from my Makefile. I would really appreciate some help. Thank you smile.png

My libs/steam directory:

http://i.imgur.com/Sn1xSEb.png

My libs/steam/lib directory:

http://i.imgur.com/FMGzG8Q.png

My Makefile:

http://i.imgur.com/yBoJmXi.png

Thanks smile.png

Advertisement

The *.lib files are for windows, for linux you should be linking a *.a or *.so file. For Mac it would be a *.framework, *.a or *.dylib file.

The -l argument to the compiler takes the basename of the library, so no 'lib' prefix, and no file extension. The -L argument takes the directory where the library files are.

So for linux I'd expect this to look something like '-Llibs/steam/lib/linux64 -lsteam_api'.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

The *.lib files are for windows, for linux you should be linking a *.a or *.so file. For Mac it would be a *.framework, *.a or *.dylib file.

The -l argument to the compiler takes the basename of the library, so no 'lib' prefix, and no file extension. The -L argument takes the directory where the library files are.

So for linux I'd expect this to look something like '-Llibs/steam/lib/linux64 -lsteam_api'.

So for Mac I can go to '-Llibs/steam/osx32' and '-lsteam_api' if there is a file that is called 'steam_api.dylib'?


So for Mac I can go to '-Llibs/steam/osx32' and '-lsteam_api' if there is a file that is called 'steam_api.dylib'?

Yep, that should do the trick.

Keep in mind that you may also have to pass the -m32 flag if you are linking against the 32bit libraries - Apple's toolchain tends to prefer 64bit these days.

Tristam MacDonald. Ex-BigTech Software Engineer. Future farmer. [https://trist.am]

Well, I FIXED IT! If it can be helpful, I was using the libs that are giving to you by the folder public/steam/libs but there is another directory that is called redistribution_bin and there are another libs, use that ones... One full day wasted...

This topic is closed to new replies.

Advertisement