Jump to content
  • Advertisement
Sign in to follow this  
CavariuX

Link SteamSDK to G++

This topic is 1090 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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'.

Share this post


Link to post
Share on other sites

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'?

Edited by CavariuX

Share this post


Link to post
Share on other sites

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.

Edited by swiftcoder

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!