app dependencies

Discussion in 'Mac Programming' started by luke9511, Feb 9, 2016.

  1. luke9511 macrumors member

    Mar 23, 2015
    hey everyone i did a search on here and google and i couldnt find what i was looking for, i have a mac app that i compiled and i want to bundle all the dependencies into the app itself but how do i make the app look inside itself to use them?
  2. szymczyk macrumors regular

    Mar 5, 2006
    Take a look at the NSBundle class. The mainBundle() function gives you access to the app bundle. There are various URLForResource() and pathForResource() functions to load files from the bundle.

    You'll get better answers if you provide more details on what you mean by "dependencies". Tell us exactly what you're trying to accomplish.
  3. luke9511 thread starter macrumors member

    Mar 23, 2015
    first what i am compiling is a crypto currency wallet for mac, i compile it using qt creator, now when it runs it searches for certain files which are installed on my system mainly some dylibs and right now after i compile it and try to run it, its trying to find libminiupnpc.10.dylib and i want to bundle this file into the app itself instead of it trying to search my computer or someone else for the file and have the app not work cause it cannot locate that file
  4. szymczyk macrumors regular

    Mar 5, 2006
    I have never used QtCreator or Qt so I can't give you an answer. I figured you were using Xcode and Cocoa. I don't know if QtCreator and Qt have message boards, but if they do, you'd have a better chance of getting a good answer there. Most of the people on this board use Xcode and Cocoa to make Mac applications.
  5. luke9511 thread starter macrumors member

    Mar 23, 2015
    i have seen some places talking about using the install_name_tool to tell the app to look for the file inside the app itself and this works for most of the files but this one for some reason does not unless i am not using the correct commands
  6. wrldwzrd89 macrumors G5


    Jun 6, 2003
    Solon, OH
    Typically you need to put frameworks in the folder "". QT is a framework, right? So embedding it therefore requires copying it to the right place and letting the app know to look internally for it.

Share This Page