3

I am writing my first game in SDL in xcode using objective C++. The Program runs fine on my computer but I am trying to include the framework in the application so it can be played on other macs with out the need to install it.

I have set the framework to copy and then link to the binary in the application build phases.

Every time I run the application on another mac i get this error message:

Process: Maze [2911]
Path: /Users/USER/Desktop/Maze.app/Contents/MacOS/Maze
Identifier: LKW.Maze
Version: 1 (1) Code Type: X86-64 (Native)
Parent Process: launchd [2811]
Date/Time: 2013-01-14 12:50:54.126 +1100
OS Version: Mac OS X 10.7.5 (11G63b)
Report Version: 9

Interval Since Last Report: 60055 sec
Crashes Since Last Report: 11
Per-App Crashes Since Last Report: 6
Anonymous UUID: 9FDDFA61-468F-4EE5-B922-EE167A9E7DF7

Crashed Thread: 0

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

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
Library not loaded: @rpath/SDL.framework/Versions/A/SDL
Referenced from: /Users/USER/Desktop/Maze.app/Contents/MacOS/Maze
Reason: image not found

Binary Images:
0x10ed3c000 - 0x10ed41fff +LKW.Maze (1 - 1) 5364749AEDEB> /Users/USER/Desktop/Maze.app/Contents/MacOS/Maze
0x7fff6e93c000 - 0x7fff6e970baf dyld (195.6 - ???) <0CD1B35B-A28F-32DA-B72E-452EAD609613> /usr/lib/dyld
0x7fff8ba34000 - 0x7fff8bd4dfff com.apple.Foundation (6.7.2 - 833.25) <22AAC369-B63C-3C55-8AC6-C3ECBA44DA7B>
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x7fff94742000 - 0x7fff94742fff com.apple.Cocoa (6.6 - ???) <7EC4D759-B2A6-3A99-AC75-809FED1500C6> /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa

Model: MacBook7,1, BootROM MB71.0039.B0E, 2 processors, Intel Core 2 Duo, 2.4 GHz, 2 GB, SMC 1.60f5
Graphics: NVIDIA GeForce 320M, NVIDIA GeForce 320M, PCI, 256 MB
Memory Module: BANK 0/DIMM0, 1 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142323837334648532D4346382020
Memory Module: BANK 1/DIMM0, 1 GB, DDR3, 1067 MHz, 0x80CE, 0x4D34373142323837334648532D4346382020
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x93), Broadcom BCM43xx 1.0 (5.106.198.19.22)
Bluetooth: Version 4.0.8f17, 2 service, 18 devices, 1 incoming serial ports
Network Service: AirPort, AirPort, en1
Serial ATA Device: Hitachi HTS545025B9SA02, 250.06 GB
Serial ATA Device: HL-DT-ST DVDRW GS23N
USB Device: Built-in iSight, apple_vendor_id, 0x8507, 0x24600000 / 2
USB Device: BRCM2070 Hub, 0x0a5c (Broadcom Corp.), 0x4500, 0x06600000 / 3
USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x8218, 0x06630000 / 5
USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0236, 0x06300000 / 2

Edit:
The SDL framework is in Contents > Frameworks in the app bundle.
I have tried Adam's work around.
I have included @executable_path/contents/framworks in the framework search paths.
I have tried both

#include "SDL/SDL.h" 
and 
#include <SDL/SDL.h>
  • It looks like a run-time crash. Run your program in a debugger, it will tell you _where_ the program crashed, let you see and walk the function call stack so you know how you ended up at the crash, and also let you examine variables to help you understand _why_ it crashed. – Some programmer dude Jan 15 '13 at 12:32
  • Possible duplicate: http://stackoverflow.com/questions/1621451/bundle-framework-with-application-in-xcode – yiding Jan 15 '13 at 12:46

1 Answers1

1

Check that the SDL framework was copied to the game's application bundle. Select the application from the Finder, right-click and choose Show Package Contents. The SDL framework should be in Contents > Frameworks in the app bundle if it was copied properly.

If the SDL framework wasn't copied to the app bundle, you can find instructions on how to copy the SDL framework to the app bundle in the following article:

Using SDL with Xcode 4

Make sure you read the comment from Adam in the article, as his comment contains a workaround if following the instructions in the article fails to copy the SDL framework to the app bundle.

Community
  • 1
  • 1
Swift Dev Journal
  • 19,282
  • 4
  • 56
  • 66