0

I am trying to port a game I made using Qt 5 to Mac OS. Everything is working fine, except that I have a pretty big Assets folder that I can't turn into a resource file.

On Windows and Linux I was using relative paths to load images from the Assets directory, essentially all the assets from the game are loaded via QImage.load("../Assets/some_asset"); and the Assets folder is of course one directory up from the executable.

I have used getcwd to determine that the working directory for my game is <path_to_app_bundle>/Contents/MacOS and then I have included the Assets folder in the application bundle in the <path_to_app_bundle>/Contents directory, but QImage.load still returns false and furthermore calling access("<path_to_app_bundle>/Contents/Assets/some_asset", F_OK) returns -1.

I have triple checked for typos and permission issues, I have also tried to include the Assets folder in all the levels of the app bundle hierarchy, nothing worked.

I'm using Mac OS X 10.9.3 and Qt 5.3 with clang.

Radu Chivu
  • 1,057
  • 7
  • 17
  • possible duplicate of [Accessing files in resources folder in mac osx app bundle](http://stackoverflow.com/questions/24165681/accessing-files-in-resources-folder-in-mac-osx-app-bundle) – TheDarkKnight Jun 26 '14 at 08:43
  • OSX resources should be in the resource folder app/Contents/Resources. Qt resources are built into the executable, so if you're not using that, this answer explains how to get to the resource files: http://stackoverflow.com/questions/24165681/accessing-files-in-resources-folder-in-mac-osx-app-bundle/24165954#24165954 – TheDarkKnight Jun 26 '14 at 08:44

0 Answers0