Results 1 to 4 of 4

Thread: Bundle SDL Framework in Bundle

  1. #1
    Join Date
    Aug 2011
    Location
    California, USA
    Posts
    24
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Bundle SDL Framework in Bundle

    Hey guys,

    So I just have a quick question. I'm trying to link to the SDL framework on OSX 10.6, but I keep running into issues when I try to run the application.

    Qt Code:
    1. dyld: Library not loaded: @rpath/SDL.framework/Versions/A/SDL
    2. Referenced from: /Users/chris/Programming/Monterey/Monterey-build-desktop-Desktop_Qt_4_8_0_for_GCC__Qt_SDK__Release/Monterey.app/Contents/MacOS/Monterey
    3. Reason: image not found
    4. The program has unexpectedly finished.
    To copy to clipboard, switch view to plain text mode 

    When I right click on Monterey.app and click "show package contents," I am able to navigate to the Frameworks subfolder and I can see that SDL is copied there. Here is my *.pro file.
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2012-03-15T20:24:49
    4. #
    5. #-------------------------------------------------
    6.  
    7. QT += core gui network svg declarative
    8.  
    9. TARGET = Monterey
    10. TEMPLATE = app
    11.  
    12. SOURCES += main.cpp\
    13. mainwindow.cpp \
    14. ../Monterey/extraclasses/QActivityMonitor/qactivitymonitor.cpp \
    15. ../Monterey/extraclasses/QBoolMonitor/qboolmonitor.cpp \
    16. ../Monterey/extraclasses/QROVMotor/qrovmotor.cpp \
    17. ../Monterey/extraclasses/QROVRelay/qrovrelay.cpp \
    18. ../Monterey/extraclasses/QROVServo/qrovservo.cpp \
    19. rovdebug.cpp \
    20. rovsettings.cpp \
    21. rovmappings.cpp \
    22. rovabout.cpp \
    23. extraclasses/QScale/qscale.cpp \
    24. extraclasses/QNeedleIndicator/qneedleindicator.cpp \
    25. extraclasses/QLedIndicator/qledindicator.cpp \
    26. extraclasses/QROV/qrov.cpp \
    27. extraclasses/QROVController/qrovcontroller.cpp \
    28. extraclasses/QROVSensor/qrovsensor.cpp \
    29. extraclasses/QJoystick/qjoystick.cpp \
    30. extraclasses/QVectorDrive2/qvectordrive2.cpp \
    31. extraclasses/QCustomPlot/qcustomplot.cpp
    32.  
    33. HEADERS += mainwindow.h \
    34. ../Monterey/extraclasses/QActivityMonitor/qactivitymonitor.h \
    35. ../Monterey/extraclasses/QBoolMonitor/qboolmonitor.h \
    36. ../Monterey/extraclasses/QROVMotor/qrovmotor.h \
    37. ../Monterey/extraclasses/QROVRelay/qrovrelay.h \
    38. ../Monterey/extraclasses/QROVServo/qrovservo.h \
    39. rovdebug.h \
    40. rovsettings.h \
    41. rovmappings.h \
    42. rovabout.h \
    43. extraclasses/QScale/qscale.h \
    44. extraclasses/QNeedleIndicator/qneedleindicator.h \
    45. extraclasses/QLedIndicator/qledindicator.h \
    46. extraclasses/QROV/qrov.h \
    47. extraclasses/QROVController/qrovcontroller.h \
    48. extraclasses/QROVSensor/qrovsensor.h \
    49. extraclasses/QJoystick/qjoystick.h \
    50. extraclasses/QVectorDrive2/qvectordrive2.h \
    51. extraclasses/QCustomPlot/qcustomplot.h
    52.  
    53. FORMS += mainwindow.ui \
    54. rovdebug.ui \
    55. rovsettings.ui \
    56. rovmappings.ui \
    57. rovabout.ui
    58.  
    59. INCLUDEPATH += ../Monterey/extraclasses/QActivityMonitor/ \
    60. ../Monterey/extraclasses/QBoolMonitor/ \
    61. ../Monterey/extraclasses/QROVMotor/ \
    62. ../Monterey/extraclasses/QROVRelay/ \
    63. ../Monterey/extraclasses/QROVServo/ \
    64. ../Monterey/extraclasses/QScale/ \
    65. ../Monterey/extraclasses/QNeedleIndicator/ \
    66. ../Monterey/extraclasses/QLedIndicator/ \
    67. ../Monterey/extraclasses/QROV/ \
    68. ../Monterey/extraclasses/QROVController/ \
    69. ../Monterey/extraclasses/QROVSensor/ \
    70. ../Monterey/extraclasses/QJoystick/
    71.  
    72.  
    73. RESOURCES += \
    74. resources.qrc
    75.  
    76. macx{
    77. ICON = monterey.icns
    78.  
    79. HEADERS += ../Monterey/extraclasses/SDL/SDLMain.h
    80. QMAKE_LFLAGS += -F../Monterey/depends/osx/
    81. LIBS += -framework SDL
    82.  
    83. OTHER_FILES += \
    84. ../Monterey/extraclasses/SDL/SDLMain.m
    85. }
    86.  
    87. win32{
    88. RC_FILE = monterey.rc
    89.  
    90. DEFINES += SDL_WIN
    91. LIBS += -lSDL.dll
    92. }
    93.  
    94. OTHER_FILES += \
    95. resources/ROV.png \
    96. resources/hsi_face.svg.png \
    97. resources/any_casing.svg.png \
    98. resources/Compass.qml \
    99. resources/HeadingIndicator.qml
    To copy to clipboard, switch view to plain text mode 

    I'd like to provide the SDL framework in the bundle if at all possible. How can I link to that framework (SDL) if it's in the bundle?

    Thanks!

    Chris

  2. #2
    Join Date
    May 2012
    Location
    Ahmedabad, Gujrat, India
    Posts
    3

    Default Re: Bundle SDL Framework in Bundle

    I have an XCode project which copies SDL.framework to my app bundle and, up until recently, this worked fine. I could give my bundle to someone who didn't have SDL.framework and it would work. But yesterday a friend of mine said my app was crashing because it couldn't find SDL.framework. I removed SDL.framework from my /Library/Frameworks folder to test it on my machine and he's right. Even though SDL.framework exists in my bundle the app still crashes because it can't find it.

  3. #3
    Join Date
    Dec 2011
    Posts
    27
    Thanks
    1
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Bundle SDL Framework in Bundle

    Quote Originally Posted by chriskon149 View Post

    I'd like to provide the SDL framework in the bundle if at all possible. How can I link to that framework (SDL) if it's in the bundle?
    Chris,

    Use macdeployqt to copy frameworks into the bundle and automatically adjust their paths. See also Deploying and Application on Mac OSX

    Here is a snippit from one of my project files which automatically does this as needed, for release builds:

    Qt Code:
    1. macx {
    2.  
    3. CONFIG(release, debug|release) {
    4.  
    5. QMAKE_POST_LINK += @echo "GRPRO: Deploying Mac app" $$escape_expand(\\n\\t)
    6. QMAKE_POST_LINK += $$[QT_INSTALL_BINS]/macdeployqt $$OUT_PWD/MyApp.app $$escape_expand(\\n\\t)
    7. QMAKE_POST_LINK += @echo "GRPRO: Copying qextserialport" $$escape_expand(\\n\\t)
    8. QMAKE_POST_LINK += cp -R $$(HOME)/lib/libqextserialport* $$OUT_PWD/MyApp.app/Contents/Frameworks/ $$escape_expand(\\n\\t)
    9. QMAKE_POST_LINK += @echo "GRPRO: Correcting paths inside of libqextserialport" $$escape_expand(\\n\\t)
    10. QMAKE_POST_LINK += install_name_tool -change $$[QT_INSTALL_LIBS]/QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore.framework/Versions/4/QtCore $$OUT_PWD/MyApp.app/Contents/Frameworks/libqextserialport.1.2.0.dylib $$escape_expand(\\n\\t)
    11. }
    12. }
    To copy to clipboard, switch view to plain text mode 

    HTH

  4. #4
    Join Date
    Aug 2011
    Location
    California, USA
    Posts
    24
    Thanks
    4
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Bundle SDL Framework in Bundle

    Quote Originally Posted by Ashtechsmith View Post
    I have an XCode project which copies SDL.framework to my app bundle and, up until recently, this worked fine. I could give my bundle to someone who didn't have SDL.framework and it would work. But yesterday a friend of mine said my app was crashing because it couldn't find SDL.framework. I removed SDL.framework from my /Library/Frameworks folder to test it on my machine and he's right. Even though SDL.framework exists in my bundle the app still crashes because it can't find it.
    I have this exact same problem. It looks like my application is looking for the SDL framework somewhere else. Can you force the application to look for the framework in the bundle first? My problem isn't getting the framework in the bundle, that's easy (although thanks to droneone's help, I can automate that task!), it is forcing my application to look in the bundle instead of looking elsewhere.

    Does anyone know how to solve this issue?

    Thanks,

    Chris
    Last edited by chriskon149; 27th June 2012 at 06:12. Reason: clarified question

Similar Threads

  1. MAC, qmake, Carbon Bundle
    By Joan in forum Qt Programming
    Replies: 0
    Last Post: 26th June 2009, 16:09
  2. Trying to deploy a bundle
    By afflictedd2 in forum Qt Programming
    Replies: 2
    Last Post: 8th May 2009, 19:39
  3. Create Qt Application Bundle in MacOs
    By joy in forum Installation and Deployment
    Replies: 2
    Last Post: 25th February 2008, 18:06
  4. HelperTool within Application Bundle?
    By vishal.chauhan in forum Qt Programming
    Replies: 7
    Last Post: 3rd January 2008, 13:19

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.