How to embed Phidget21.framework into App Bundle

Supporting 10.7 and up
RobMac
Fresh meat
Posts: 3
Joined: Fri Apr 04, 2014 11:04 am
Location: Stuttgart, Germany
Contact:

How to embed Phidget21.framework into App Bundle

Postby RobMac » Fri Apr 04, 2014 11:12 am

How can I embed the phidget framework into my application bundle?
I want my app to run on all macs (then without the phidget functionality), but when it launches on a machine without the framework installed, I get the error:
"Dyld Error Message:
Library not loaded: /Library/Frameworks/Phidget21.framework/Versions/A/Phidget21"

I already copied the framework inside the "Contents/Framework" Folder and in Xcode is set "Runpath Search Path" to "@loader_path/../Frameworks"

Thanks for help!

(Using Xcode 5 on 10.9.2)

User avatar
Patrick
Lead Developer
Posts: 3099
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: How to embed Phidget21.framework into App Bundle

Postby Patrick » Fri Apr 04, 2014 11:59 am

Not sure why this wouldn't work, but also remember that the Phidget KEXT is required, and this cannot be bundled in your application - it must be installed in /System/Extensions

-Patrick

RobMac
Fresh meat
Posts: 3
Joined: Fri Apr 04, 2014 11:04 am
Location: Stuttgart, Germany
Contact:

Re: How to embed Phidget21.framework into App Bundle

Postby RobMac » Fri Apr 04, 2014 12:16 pm

but also remember that the Phidget KEXT is required


Sure, but I want to run my app, even if no Phidget is installed, then with less functionality. But my app doesn't run at all.

What is the correct way to embed a private, precompiled framework? Google didn't help me so far ...

User avatar
Patrick
Lead Developer
Posts: 3099
Joined: Mon Jun 20, 2005 8:46 am
Location: Canada
Contact:

Re: How to embed Phidget21.framework into App Bundle

Postby Patrick » Mon Apr 07, 2014 10:07 am

Your method mentioned is all you should have to do. I have not actually tried this myself.

Probably a typo, but I did notice that your two paths are not the same: /Frameworks vs. /Framework

You could also link phidget21 at runtime rather then compile time, and require users who have Phidgets to just install our installer.

-Patrick

RobMac
Fresh meat
Posts: 3
Joined: Fri Apr 04, 2014 11:04 am
Location: Stuttgart, Germany
Contact:

Re: How to embed Phidget21.framework into App Bundle

Postby RobMac » Wed Apr 09, 2014 3:28 am

You could also link phidget21 at runtime rather then compile time


What do I have to do to make that happen? Wouldn't Xcode complain if i don´t write:
#import <Phidget21/phidget21.h>

Thanks for your help!
Rob


Return to “macOS”

Who is online

Users browsing this forum: No registered users and 1 guest