Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Embedding WebKit.framework in my application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Embedding WebKit.framework in my application



Dave,

On 05/02/2008, at 02:47, Dave Verwer wrote:

I am kinda new to all of this so please bear with me if this is obvious.

I am trying to embed WebKit.framework into my application and I am
getting an intermittent linker error when building my app.

Embedding the WebKit framework in your application is not something that we recommend doing. There are several issues associated with doing this. One is that WebKit is compiled targetting a specific version of Mac OS X (either 10.4 or 10.5), and a version built on 10.4 will sometimes behave unexpectedly when running on 10.5. Other issues are choosing a stable version to use (trunk is where development happens, so it often has regressions which are yet to be fixed), and tracking any security updates to WebKit going forward. If at all possible, I would strongly suggest that you rely on the system version of WebKit.


ld: warning in /Users/dave/Documents/Xcode/WebKit/WebKitBuild/ Release/WebKit.framework/WebKit,
file is not of required architecture

This suggests that /Users/dave/Documents/Xcode/WebKit/WebKitBuild/ Release/WebKit.framework is a single-architecture
binary while you are attempting to build a universal binary of your application. For Xcode to be able to link to the framework, it also needs to be built as a universal binary.


I am not sure I embedded the framework in the right way and while
there are snippets of documentation across the web and mailing list
archives I am not sure I have done everything necessary, this is what
I have done:

1. Checked out WebKit from svn and built it using
WebKitTools/Scripts/build-webkit creating a WebKit.framework in
WebKitBuilds/Release.
2. Removed the reference to the system WebKit.framework from my Xcode project.
3. Added a reference to the WebKit.framework in WebKitBuilds/Release.
4. Added a new copy files build phase to the target, specifying
"Frameworks" as the destination and adding the reference to the newly
included WebKit.framework under it.


Something has definitely worked as my .app now has a Frameworks folder
in it containing the WebKit.framework but sometimes (i have noticed
that it is after doing a "Clean All" from Xcode or whenever I build
from TextMate) I get the linker warning above and the application
hangs when it tries to use new (post Leopard) WebKit functionality. If
I get a successful link, obviously the new WebKit functionality works.

Note: I am using getElementsByClassName[1] to test for new webkit
functionality as it is something that I know is definitely different
between the system shipped WebKit and the one I am building.

So, am I doing anything wrong or missing anything vital in the steps I
have outlined above?

From what I can find on the web I have a feeling that this is
something to do with install_name_tool and I have tried doing
install_name_tool -change changing it to use @executable_path but as
it seems I have to call this on the built executable, this is going to
need doing every time? If so, should I be adding some kind of build
step to do this?

This could be done at WebKit build time by changing the installation paths in the various Xcode projects in the WebKit source tree. Alternatively, you could use a shell script phase to make the change early in your build process.


- Mark

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webkitsdk-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Embedding WebKit.framework in my application (From: "Dave Verwer" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.