Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error: cannot find protocol declaration for 'WebPolicyDelegate' #3

Closed
hanxue opened this issue Apr 25, 2016 · 3 comments
Closed

Comments

@hanxue
Copy link

hanxue commented Apr 25, 2016

My machine has the following configuration

OSX 10.10.5
Xcode 6.4
Build version 6E35b

I run the following build command

xcodebuild -project /tmp/ichm-1.5/ichm.xcodeproj/ -target "iChm" SYMROOT=build -verbose

And got this error

The following build commands failed:
    CompileC build/ichm.build/Release/iChm.build/Objects-normal/x86_64/ITSSProtocol.o ITSSProtocol.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

Full output of xcodebuild here https://gist.github.com/hanxue/c39b6ea7e8457ff2130278ff11c19b03

@NSGod
Copy link
Owner

NSGod commented Apr 27, 2016

Prior to the OS X 10.11 SDK, <WebUIDelegate> was an informal protocol. In other words, since you're building against the OS X 10.10 SDK, the WebUIDelegate is defined as:

@interface NSObject (WebUIDelegate)
// various methods
@end

In the OS X 10.11 SDK, it became a formal protocol.

You can do a couple of things.

  1. Upgrade to Xcode 7.2.1 which includes the OS X 10.11 SDK and runs in OS X 10.10.5 (the same OS X I'm running here).
  2. Otherwise, you could try doing a forward declaration in CHMDocument.h
@protocol WebUIDelegate;

@interface CHMDocument : NSDocument <NSToolbarDelegate, WebPolicyDelegate, WebResourceLoadDelegate, WebFrameLoadDelegate, WebUIDelegate> {

That may allow the code to compile, though you may get warnings about not finding a definition for the protocol.

3.Alternatively, you could simply remove WebUIDelegate from the list of protocols CHMDocument conforms to, by changing:

@interface CHMDocument : NSDocument <NSToolbarDelegate, WebPolicyDelegate,
                    WebResourceLoadDelegate, WebFrameLoadDelegate, WebUIDelegate> {

to:

@interface CHMDocument : NSDocument <NSToolbarDelegate, WebPolicyDelegate,
                                    WebResourceLoadDelegate, WebFrameLoadDelegate> {

@NSGod NSGod closed this as completed Apr 27, 2016
@NSGod
Copy link
Owner

NSGod commented Apr 28, 2016

Looking into this more, and will try to make the project as backward compatible as possible.

@NSGod NSGod reopened this Apr 28, 2016
@NSGod
Copy link
Owner

NSGod commented May 2, 2016

This issue should now be fixed in bfc5d04.

@NSGod NSGod closed this as completed May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants