• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
bencelot

Compiling GLIBC on Linux. Oh golly gosh!

16 posts in this topic

I'm trying to compile my game on Linux. It works find on my Ubuntu system, but when I send the compiled binary off to my buddy with Centos it won't run. It complains saying:


/lib64/libc.so.6: version `GLIBC_2.7' not found
/lib64/libc.so.6: version `GLIBC_2.11' not found
/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.9' not found
/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.11' not found

I've googled around the place and it seems that because I compiled on my new computer it's not going to work on his old computer. Whereas if I'd compiled on an old computer it would've worked fine on both. Crazy old Linux! He only has GLIBC_2.5 on his Centos machine, whereas I have 2.11. What I'd like though is for my binary to run on as many installations as possible. I really don't want to have to set up a whole new installation with an old version of GLIBC just to recompile it again. So first of all, can I force my project to compile at the lowest level of GLIBC possible? Or at the very least, how do I remove these [size="2"]symbols (from running: objdump -T MYGAME):[/size]

GLIBC_2.4 __stack_chk_fail
GLIBC_2.7 __isoc99_sscanf
GLIBC_2.11 __longjmp_chk
GLIBCXX_3.4.11 _ZNKSt5ctypeIcE13_M_widen_initEv
GLIBCXX_3.4.9 _ZNSo9_M_insertIbEERSoT_
GLIBCXX_3.4.9 _ZSt16__ostream_insertIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_PKS3_l
GLIBCXX_3.4.9 _ZNSo9_M_insertImEERSoT_
GLIBCXX_3.4.9 _ZNSo9_M_insertIdEERSoT_
GLIBCXX_3.4.9 _ZNSi10_M_extractIfEERSiRT_


My understanding is that if I remove these symbols from my code/project then it'll run fine on my buddies computer. Of course ideally, if there's a way to support even lower than that this would be awesome. So what's the best course of action here? Is there some compiler option to automatically support the oldest versions of GLIBC and GLIBCXX? Or maybe I have to manually go through and weed all these symbols out (also probably through some compiler options).. or maybe I need to statically link against libc.so.6 and libstdc++.so.6?

Anyway, any help would be greatly appreciated :D
Cheers,
Ben.
0

Share this post


Link to post
Share on other sites
Not every Linux distro is the same. Hence the reason why every distro has their own package manager and it's own set up packaged versions.
0

Share this post


Link to post
Share on other sites
On Linux it's often much easier to just give the source code to the user so he can compile it himself.
0

Share this post


Link to post
Share on other sites
[quote name='Seaßourne' timestamp='1296807957' post='4769417']
every distro has their own package manager
[/quote]

Uhm ...

There are only two "mainstream" packaging systems, debs and rpms. And in many cases, carefully stuffed packages install on many distros that understand the package in question. The last deb I've personally distributed e.g. would install on at least Ubuntus 10.x, Debians 5.x, Mint and gNewSense (others not tested).



O.P.: Maybe [url="http://freshmeat.net/projects/statifier"]ELF Statifier[/url] could be of interest to you, though it completely circumvents the whole idea behind package managers. An extravagant idea could also be to setup a virtualbox-image :D
0

Share this post


Link to post
Share on other sites
Here you go:
http://ldn.linuxfoundation.org/lsb/build-lsb-compliant-application

If you intend to do cross distribution binary only applications the LSB is your best friend.
0

Share this post


Link to post
Share on other sites
Here you go:
http://ldn.linuxfoundation.org/lsb/build-lsb-compliant-application

If you intend to do cross distribution binary only applications the LSB is your best friend.
0

Share this post


Link to post
A third alternative you could consider is to build your game statically.

You get this exact same problem on Microsoft Windows. Often times application vendors work around simply by shipping all the runtimes with their app (eg. MSVCRT.DLL and friends).
0

Share this post


Link to post
Share on other sites
Thanks for all the suggestions guys :D

Katie, thx for that massive reply. I think I might set up a chroot environment. Can you reccomend a good distrbution to target the lowest level possible (for maximum compatibility)?
0

Share this post


Link to post
Share on other sites
Centos, RHEL, SLES and some other distros intended for 'enterprise' type machines have relatively old (aka 'stable') versions of most software compared to something like Ubuntu so you have to be aware of that if you intend to distribute binaries.
0

Share this post


Link to post
Share on other sites
So, I could be wrong here, but did you try checking to see whether he is running a 32-bit install? Its obvious that you are running a 64-bit install...is it possible he has a 32?
0

Share this post


Link to post
Share on other sites
He has 64 bit. But that's another good point.. obviously I want my game to be playable on both 32 and 64 bit installations. What's the best way to deal with this? Is it possible to create 1 binary that will work on both? Or do I need to build 2 separate binaries?
0

Share this post


Link to post
Share on other sites
[quote name='bencelot' timestamp='1296870928' post='4769848']
He has 64 bit. But that's another good point.. obviously I want my game to be playable on both 32 and 64 bit installations. What's the best way to deal with this? Is it possible to create 1 binary that will work on both? Or do I need to build 2 separate binaries?
[/quote]Create an LSB-compliant 32-bit binary, make sure your program depends on the proper 32-bit packages. Unless you're going to use 2+ gigs of RAM, there's no point in also creating a 64-bit binary.
0

Share this post


Link to post
Share on other sites
Hmm ok. So can I create 32 bit chroot environment and compile within that? Any suggestions? Or do I need to add some compiler flag to make it 32bit (I'm on a 64bit machine).
0

Share this post


Link to post
Share on other sites
[quote name='valderman' timestamp='1296905086' post='4769956']
[quote name='bencelot' timestamp='1296870928' post='4769848']
He has 64 bit. But that's another good point.. obviously I want my game to be playable on both 32 and 64 bit installations. What's the best way to deal with this? Is it possible to create 1 binary that will work on both? Or do I need to build 2 separate binaries?
[/quote]Create an LSB-compliant 32-bit binary, make sure your program depends on the proper 32-bit packages. Unless you're going to use 2+ gigs of RAM, there's no point in also creating a 64-bit binary.
[/quote]

Except all those additional juicy registers and a better ABI, and SSE2 minspec. No reason at all :)
1

Share this post


Link to post
Share on other sites
[quote name='Zoner' timestamp='1297054390' post='4770748']Except all those additional juicy registers and a better ABI, and SSE2 minspec. No reason at all :)[/quote]



More registers are fine, but the performance benefit is mitigated by the fact that the larger memory footprint of 64-bit code leads to more cache trashing. [url="http://www.phoronix.com/scan.php?page=article&item=616&num=1"]In effect, performance of 64-bit code can be worse than 32-bit code.[/url]
1

Share this post


Link to post
Share on other sites
[quote name='Zoner' timestamp='1297054390' post='4770748']
[quote name='valderman' timestamp='1296905086' post='4769956']
[quote name='bencelot' timestamp='1296870928' post='4769848']
He has 64 bit. But that's another good point.. obviously I want my game to be playable on both 32 and 64 bit installations. What's the best way to deal with this? Is it possible to create 1 binary that will work on both? Or do I need to build 2 separate binaries?
[/quote]Create an LSB-compliant 32-bit binary, make sure your program depends on the proper 32-bit packages. Unless you're going to use 2+ gigs of RAM, there's no point in also creating a 64-bit binary.
[/quote]

Except all those additional juicy registers and a better ABI, and SSE2 minspec. No reason at all :)
[/quote]Then it's better to just compile a second binary with -msse2. As demonkoryu says, more registers and fancier instructions do nothing for you if you hit RAM all the time. Add in the porting issues you get for using a low-level language and maintaining two binaries suddenly seems a lot less attractive.
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0