Mac OSX, where to put the SDL Framework?

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?

Contents/MacOS/YourAppName
Contents/Frameworks/SDL.framework

JosephOn Fri, Oct 02, 2015 at 06:05:57PM +0000, lakibuk wrote:

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?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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:
[Image: http://www.blueskied.com/images/misc/MacProject.png ]

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

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

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 DOn Saturday, October 3, 2015, lakibuk wrote:

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

You would need to specify linking paths. On OSX there are several ways to
do this, see here:

https://wincent.com/wiki/@executable_path,_ at 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: 9997478768On Sat, Oct 3, 2015 at 2:40 PM, lakibuk wrote:

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
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

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