Results 1 to 9 of 9

Thread: Mac OS X app bundle can't find bundled framework files

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Thanks! I'm going insane trying to get the new version to work on Mac OS X, though.

    From advise elsewhere, it does seem like Xcode's linking phase should have an affect, which makes sense, since I believe the whole point of doing this through Xcode is to use its linker. So now I'm stuck again.
    Last edited by Christian Knudsen; 19-02-2015 at 11:11 AM.
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

  2. #2
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    Hmm. I've googled like a mad man and I've only managed to find the following pages that bare any resemblance to your problem :

    http://stackoverflow.com/questions/9...d-by-xcode-app

    http://forum.lazarus.freepascal.org/...?topic=20252.0

    along with the compiler directive {$linklib}

    also I had a problem with relative paths in bundles long ago during debugging/executing from my IDE (but it was my data files and not a lib) does it still happen when you run the bundle directly?

    Try an absolute path to a point in your file-system rather than the relative "@executable_path/../Frameworks"

    If an absolute path doesn't work then either the SDL2 libs you have are not valid (32bit vs 64bit?) or that directory is simply not being passed to the linker.

    Perhaps installing Lazarus and compiling there - see if you can replicate the problem. Also while it can't find the libs in the path you specify, perhaps it is looking elsewhere, try placing them at the root of the bundle, next to the binary etc. Perhaps the default path will be one of these.

    I think it would be worth eliminating those dynamic libs as the source of the problem (although to be fair they're likely fine) perhaps an existing SDL2 mac game/program that you can examine/swap files in.

    Can OSX have shared libraries in a system location? if so, try putting the SDL2 libs there which should definitely work - I know you want to bundle it all together but it will at least confirm this is a path issue and not something we're not guessing.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  3. #3
    PGD Staff / News Reporter phibermon's Avatar
    Join Date
    Sep 2009
    Location
    England
    Posts
    524
    It would help if we understood the nature of the relative paths etc

    it might be worth getting an existing SDL2 bundle online and just swapping in your binary - perhaps the path isn't compiled into the binary at all, perhaps it's defined in some other file in the bundle.

    If needs be I'll fire up my Hackintosh and attempt to replicate your conditions
    Last edited by phibermon; 19-02-2015 at 01:54 PM.
    When the moon hits your eye like a big pizza pie - that's an extinction level impact event.

  4. #4
    Everything runs fine if I have the SDL2 frameworks in /Library/Frameworks.

    But trying to find en existing SDL2 bundle and see if I can just use the frameworks from that is a brilliant idea. I'll see if I can find one. (Though I'm just using the SDL2 frameworks downloaded directly from libsdl.org and if they can't be bundled with my app, it must be a problem with my app and not the frameworks?)
    Last edited by Christian Knudsen; 19-02-2015 at 02:25 PM.
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

  5. #5
    Yes!

    Adding -k"-rpath @executable_path/../Frameworks" as a custom linker option for FPC did it!



    So the linker parameters weren't passed on from Xcode to Free Pascal. At this point I'm wonder what exactly I'm using Xcode for?!
    Laserbrain Studios - Currently developing Hidden Asset!
    Ascii Sector
    - Real-time roguelike in space!

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
  •