An trying to get openframeworks to build me my application so that i can open it from anywhere and it will load the needed images from within the apps Resources folder.
I believe this is relative linking?
I have done it before, on an older xcode and oF 61.
To do this i dragged the needed images into the project file on the left and added it to the executable target, with in a 'build phase' -> 'copy files'.
Been trying all sorts of methods, ofSetDataPathRoot() which solved the problem last time isnt working for me this time.
Any ideas/help would be appreciated!
Thanks
ofSetDataPathRoot()should solve this problem. Perhaps you are setting the replacement root path incorrectly?Try calling ofToDataPath() yourself on a string path and print out the result, then use Terminal and
cdinside the .app bundle to check if the path sounds correct. Paths are expressed relative to the location of the actual executable inside the .app bundle, so if the executable is atmyApp.app/Contents/MacOS/myAppand the data files are atmyApp.app/Contents/ResourcesthenofToDataPath( "texture.png" )should return something like../Resources/texture.png.You can double-check the current working directory (
myApp.app/Contents/MacOSin my example) by callinggetcwd(), open up a terminal and typeman getcwdfor more info on that.