Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

luke9511

macrumors member
Original poster
Mar 23, 2015
60
0
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?
 
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.
 
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
 
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.
 
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
 
Typically you need to put frameworks in the folder "Name.app/Contents/Frameworks". 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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.