The SDL forums have moved to discourse.libsdl.org.
This is just a read-only archive of the previous forums, to keep old links working.


SDL Forum Index
SDL
Simple Directmedia Layer Forums
Mac OSX, where to put the SDL Framework?
lakibuk


Joined: 11 Jan 2015
Posts: 8
I just ported a Windows game to OSX.
The APP works, but only on this computer.
Cause: The APP is looking for the framework in \Library\Frameworks\.
On a different computer it's not there and the APP crashes.
How do i link it in a correct way?
Mac OSX, where to put the SDL Framework?
Joseph Carter


Joined: 20 Sep 2013
Posts: 279
Contents/MacOS/YourAppName
Contents/Frameworks/SDL.framework

...

Joseph

On Fri, Oct 02, 2015 at 06:05:57PM +0000, lakibuk wrote:
Quote:
I just ported a Windows game to OSX.
The APP works, but only on this computer.
Cause: The APP is looking for the framework in \Library\Frameworks\.
On a different computer it's not there and the APP crashes.
How do i link it in a correct way?





Quote:
_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
lakibuk


Joined: 11 Jan 2015
Posts: 8
Thanks for your reply.
The framework is in the APP bundle as you suggested.
Still the framework gets linked from \Library\Frameworks\ on start.

Here's my project's structure:
lakibuk


Joined: 11 Jan 2015
Posts: 8
That's the crash report:

Process: FrozenFruits4_OSX_APP [3652]
Path: /Developer/Projekte/FrozenFruits4_OSX_APP/build/Debug/FrozenFruits4_OSX_APP.app/Contents/MacOS/FrozenFruits4_OSX_APP
Identifier: com.yourcompany.FrozenFruits4-OSX-APP
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: launchd [88]

Date/Time: 2015-10-03 11:06:58.147 +0200
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6

Interval Since Last Report: 233842 sec
Crashes Since Last Report: 93
Per-App Crashes Since Last Report: 42

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 0

Dyld Error Message:
Library not loaded: @rpath/SDL2.framework/Versions/A/SDL2
Referenced from: /Developer/Projekte/FrozenFruits4_OSX_APP/build/Debug/FrozenFruits4_OSX_APP.app/Contents/MacOS/FrozenFruits4_OSX_APP
Reason: image not found
Mac OSX, where to put the SDL Framework?
Alex Szpakowski
Guest

Are you sure the frameworks are getting copied to game.app/Contents/Frameworks/ and not game.app/Contents/Resources/ or some other subfolder? The Copy Files build phase lets you select a specific subfolder that the files are copied to.
Quote:
On Oct 3, 2015, at 5:56 AM, lakibuk wrote:
Thanks for your reply.The framework is in the APP bundle as you suggested.Still the framework gets linked from \Library\Frameworks\ on start.

Mac OSX, where to put the SDL Framework?
Jonny D


Joined: 12 Sep 2009
Posts: 932
I would suggest that you remove the SDL framework from Library/Frameworks/ and move it elsewhere.  Set up your linked frameworks again to link and bundle from the new location.  Perhaps then there won't be implicit linking with the framework in the default path?

Jonny D


On Saturday, October 3, 2015, lakibuk wrote:
Quote:
That's the crash report:

Process: FrozenFruits4_OSX_APP [3652]
Path: /Developer/Projekte/FrozenFruits4_OSX_APP/build/Debug/FrozenFruits4_OSX_APP.app/Contents/MacOS/FrozenFruits4_OSX_APP
Identifier: com.yourcompany.FrozenFruits4-OSX-APP
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: launchd [88]

Date/Time: 2015-10-03 11:06:58.147 +0200
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6

Interval Since Last Report: 233842 sec
Crashes Since Last Report: 93
Per-App Crashes Since Last Report: 42

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 0

Dyld Error Message:
Library not loaded: @rpath/SDL2.framework/Versions/A/SDL2
Referenced from: /Developer/Projekte/FrozenFruits4_OSX_APP/build/Debug/FrozenFruits4_OSX_APP.app/Contents/MacOS/FrozenFruits4_OSX_APP
Reason: image not found

Mac OSX, where to put the SDL Framework?
Pallav Nawani


Joined: 19 May 2011
Posts: 122
Location: Dehradun, India
You would need to specify linking paths. On OSX there are several ways to do this, see here:


https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath


Pallav Nawani
IronCode Gaming Private Limited
Website: http://www.ironcode.com
Twitter:  http://twitter.com/Ironcode_Gaming
Facebook: http://www.facebook.com/Ironcode.Gaming
Mobile: 9997478768



On Sat, Oct 3, 2015 at 2:40 PM, lakibuk wrote:
Quote:
That's the crash report:

Process: FrozenFruits4_OSX_APP [3652]
Path: /Developer/Projekte/FrozenFruits4_OSX_APP/build/Debug/FrozenFruits4_OSX_APP.app/Contents/MacOS/FrozenFruits4_OSX_APP
Identifier: com.yourcompany.FrozenFruits4-OSX-APP
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: launchd [88]

Date/Time: 2015-10-03 11:06:58.147 +0200
OS Version: Mac OS X 10.6.8 (10K549)
Report Version: 6

Interval Since Last Report: 233842 sec
Crashes Since Last Report: 93
Per-App Crashes Since Last Report: 42

Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000002, 0x0000000000000000
Crashed Thread: 0

Dyld Error Message:
Library not loaded: @rpath/SDL2.framework/Versions/A/SDL2
Referenced from: /Developer/Projekte/FrozenFruits4_OSX_APP/build/Debug/FrozenFruits4_OSX_APP.app/Contents/MacOS/FrozenFruits4_OSX_APP
Reason: image not found


_______________________________________________
SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

lakibuk


Joined: 11 Jan 2015
Posts: 8
Thanks for your hints, it works now.
What i did:
1.) Copy framework to project folder
2.) Add @executable_path/../Frameworks in Runpath Search Paths