Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

879770 Posts in 33005 Topics- by 24379 Members - Latest Member: alisiahl87

May 24, 2013, 10:46:47 PM
TIGSource ForumsDeveloperTechnical (Moderators: Glaiel-Gamer, ThemsAllTook)Releasing a C++/SDL game for Mac
Pages: [1]
Print
Author Topic: Releasing a C++/SDL game for Mac  (Read 1391 times)
Robotacon
Pixelhead
Level 3
******


Story mode


View Profile
« on: January 29, 2011, 11:02:41 AM »

I can't find a anywhere on the net how to release a game built with C++/SDL for Mac.
I have a buddy who will work on graphics and game design on a game built with my game motor
but I can't seem to send him any files he can run. This makes me worried that releasing this
game will be trouble as well.

Can anyone point me in the right direction?

/ Robo
Logged
mcc
Level 10
*****


glitch


View Profile WWW Email
« Reply #1 on: January 29, 2011, 11:12:40 AM »

The easiest way to do this is to find a mac (or get a mac VM image), install the apple Developer Tools, load all your C++ files into XCode and hit build.

You will need to be careful that you relied actually on the SDL and didn't call any wgl stuff.

There is almost certainly a way to get a cross compiler that runs on Windows but outputs mac .apps, but I think this will be more work than just finding someone who has a mac and will let you use their computer for a couple hours to make a final build. It is unfortunately I think a bit easier to build windows exes from mac than the other way around.

I have a sample project here that includes build files for both Mac and Windows if that helps. (There's a new, unfinished version of the same sample project here that supports iPhone, but I think the original is what you're interested in.)
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Robotacon
Pixelhead
Level 3
******


Story mode


View Profile
« Reply #2 on: January 30, 2011, 12:16:15 PM »

Thank you Mcc that's really nice. Being able to get a cross platform build would be great.
I am developing on a Macbook Pro so I can compile the project and all but my problem is distributing the game to anyone on a Mac that does not have Xcode and SDL installed.

If I understand SDL right these libraries needs to be linked in but can't be part of my release. And even when I try and send the SDL libraries and put them in the same directory as the game.app it still doesn't run. I'm simply not fluent enough in how Mac works to figure out what I have to do to get other mac owners to run my game.

Thanx again for the link though. I'll have a look at it.

I'm going to ask the guys at the SDL forum. Why didn't I think of that?
Logged
mcc
Level 10
*****


glitch


View Profile WWW Email
« Reply #3 on: January 30, 2011, 01:32:24 PM »

Thank you Mcc that's really nice. Being able to get a cross platform build would be great.
I am developing on a Macbook Pro so I can compile the project and all but my problem is distributing the game to anyone on a Mac that does not have Xcode and SDL installed.

If I understand SDL right these libraries needs to be linked in but can't be part of my release. And even when I try and send the SDL libraries and put them in the same directory as the game.app it still doesn't run. I'm simply not fluent enough in how Mac works to figure out what I have to do to get other mac owners to run my game.

Thanx again for the link though. I'll have a look at it.

I'm going to ask the guys at the SDL forum. Why didn't I think of that?
Oh!

No, you are allowed to redistribute the SDL libraries. It's LGPL so as long as you're including the whole framework you just have to put a line in your README citing the license terms. You are not supposed however to put the library in the same folder. The way macs do it is you tell XCode to link in the "framework" in a specific way (it might just be the "add framework" menu item, it's been awhile but it's really simple) and then XCode will automatically pack the framework inside of the generated .app.

I think my first link above will be helpful, I have a single project that has an XCode project along with a mingw makefile (you can install mingw on your mac and use it to create windows .exes).

Checking the SDL forum or seeing if they have an IRC channel is probably a good call.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Robotacon
Pixelhead
Level 3
******


Story mode


View Profile
« Reply #4 on: January 30, 2011, 03:10:33 PM »

Thanks a lot for the help! That solved it!
I feel much better now, I had the whole license thing backwards.
I'm going to sleep like a child tonight.

Cheers!
Logged
Evan Balster
Level 10
*****


dreaming close to metal


View Profile WWW Email
« Reply #5 on: January 31, 2011, 12:03:49 PM »

For future reference, you can just drop a framework into the "frameworks" folder in the app package.  (Create the folder yourself if it doesn't exist.)
Logged

Infinite Blank, SoundSelf, Cave Story+, Wreath
voice, accordion, mandolin, (oboe, soon)
Game audio programming consultant.
<plaid/audio>: opensource audio framework
Average Software
Level 10
*****

Fleeing all W'rkncacnter


View Profile WWW Email
« Reply #6 on: January 31, 2011, 12:18:58 PM »

No, you are allowed to redistribute the SDL libraries. It's LGPL so as long as you're including the whole framework you just have to put a line in your README citing the license terms.

You need more than that actually.  The LGPL requires you to either provide the SDL source, or document to the user where they may obtain the source that you used.  Linking the user to the official SDL sources does not satisfy the LGPL, because you may not have used those sources.
« Last Edit: January 31, 2011, 12:43:13 PM by Average Software » Logged

Franchise - The restaurant wars begin!

What would John Carmack do?
Overkill
Level 3
***


Andrew G. Crowell

overkill9999@gmail.com Minimum+Overkill
View Profile WWW Email
« Reply #7 on: January 31, 2011, 08:05:05 PM »

If you statically link a library released under LGPL into your program, it is considered a "derivative work", so you must also release your whole program under the LGPL (or compatible license). If you statically link, you definitely can't release programs without providing your program's full source, or object files that can be linked together to make your program, because that'd be in violation of the LGPL. You also can't release your engine under, for example, MIT or 3-clause BSD which is more permissive, because as long as SDL is statically linked (and thus your engine is "derivative" of SDL), you need to enforce that all derivatives of your engine (which, transitively, are derived from SDL) also adhere to the terms of the LGPL.

So the only way to avoid this "viral" spread of their license onto your code is to dynamically link their library and distribute it with the license text, at which point you're "using" the library, not "deriving" from it.

Correct me if I'm wrong here.
« Last Edit: February 01, 2011, 02:22:46 PM by Overkill » Logged

mcc
Level 10
*****


glitch


View Profile WWW Email
« Reply #8 on: February 01, 2011, 12:11:23 AM »

Overkill: "Frameworks" are an OS X system for dynamic linking. (In case the phrase "pack the framework inside of the generated .app" is misleading: ".app"s are directories.) Similarly SDL is usually distributed as DLL on Windows I think.

Average Software: I was assuming a lack of modifications to be implicit in "so long as you're including the whole framework".

The line I use in my README to satisfy the LGPL license requirements is:

Quote
* SDL 1.2.13 included as per version 2 of the GNU LGPL, see: http://www.libsdl.org/

I consider this to be sufficient both for providing the original source and also the text of the LGPL, since both are available at that link.

If I'm doing this wrong somebody tell me quick.
Logged

My projects:<br />Games: Jumpman Retro-futuristic platforming iJumpman iPhone version Drumcircle PC+smartphone music toy<br />More: RUN HELLO
Evan Balster
Level 10
*****


dreaming close to metal


View Profile WWW Email
« Reply #9 on: February 01, 2011, 05:52:51 AM »

I wasn't aware that anything more than the use of the dynamic library was needed to satisfy LGPL.  At the very least, I think it isn't typically a concern if the acknowledgement is forgotten.

Of course, good to be prudent.  In more final releases of my software I plan to properly credit all tools and resources used.  I also donated to SDL and you should too because it's awesome and free.
Logged

Infinite Blank, SoundSelf, Cave Story+, Wreath
voice, accordion, mandolin, (oboe, soon)
Game audio programming consultant.
<plaid/audio>: opensource audio framework
Average Software
Level 10
*****

Fleeing all W'rkncacnter


View Profile WWW Email
« Reply #10 on: February 01, 2011, 06:03:54 AM »

Average Software: I was assuming a lack of modifications to be implicit in "so long as you're including the whole framework".

Whether you modified SDL or not is irrelevant.  If you ship it in binary form, you are now a distributor and the conveyance clause of the LGPL (which is inherited from the full GPL) comes into effect.  At this point you must provide the source in a GPL accepted manner.

Quote
The line I use in my README to satisfy the LGPL license requirements is:

Quote
* SDL 1.2.13 included as per version 2 of the GNU LGPL, see: http://www.libsdl.org/

I consider this to be sufficient both for providing the original source and also the text of the LGPL, since both are available at that link.

If I'm doing this wrong somebody tell me quick.

That is wrong.  You must include a copy of the full license.

As for the source, it depends on whether SDL is licensed LGPL2 or 3, which I'm having trouble determining from their website (they say 2 but link to 3).

Your notice is not sufficient for LGPL2, you must bundle the source.

I believe the notice would be sufficient for LGPL3 if you changed the link to reference the exact source code used by the binary you distributed.  However, you're liable for that source for what seems to be a term of 3 years, so if the address you provide changes, you are no longer in compliance.

Note that SDL website says this:

Quote
If you include the SDL library in binary form, you should also make available the source code to the version you provide

Your safest bet is to ship the source.

Disclaimer:  I am not a lawyer, but I've researched this stuff pretty extensively for my own use.  I've never used SDL, so I never looked too hard into this particular case.
Logged

Franchise - The restaurant wars begin!

What would John Carmack do?
Evan Balster
Level 10
*****


dreaming close to metal


View Profile WWW Email
« Reply #11 on: February 01, 2011, 06:05:55 AM »

Virus-like is right.  :/

I plan to release my own stuff under MIT-like licenses.  So much less hassle.
Logged

Infinite Blank, SoundSelf, Cave Story+, Wreath
voice, accordion, mandolin, (oboe, soon)
Game audio programming consultant.
<plaid/audio>: opensource audio framework
sinoth
Level 0
***


hotdogger

sinothdither
View Profile WWW Email
« Reply #12 on: February 01, 2011, 07:03:47 AM »

Virus-like is right.  :/

I plan to release my own stuff under MIT-like licenses.  So much less hassle.

I hear you.  MIT-like all the way!  Granted, I've never had my work stolen and monetized by a MegaCorp, but forcing GPL down people's throats on the off chance that it will is not appealing to me in the slightest.  I've always liked the SQLite "license":

May you do good and not evil
May you find forgiveness for yourself and forgive others
May you share freely, never taking more than you give.
Logged

i am not regret
Evan Balster
Level 10
*****


dreaming close to metal


View Profile WWW Email
« Reply #13 on: February 01, 2011, 09:02:59 AM »

Amen, brother.  Programmers need to write more poetry.

(Well, poetry for people instead of computers)
Logged

Infinite Blank, SoundSelf, Cave Story+, Wreath
voice, accordion, mandolin, (oboe, soon)
Game audio programming consultant.
<plaid/audio>: opensource audio framework
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic