0

I am trying to write a simple QuickLook plugin based on apple dev docs and this blog post.

But as son as I add

#import <Cocoa/Cocoa.h>

in the beginning of the *.c file I get an error: Could not build module Cocoa

Which looks like this: enter image description here

I've also tried to add thos libe as a deps in the project, like this: enter image description here with no luck.

I've already tried to reinstall xcode. Also I've read those: iOS : Could not build module <framework-name>, Xcode 5 Couldn't build module Cocoa after installing Xcode 6 beta 2.

I have xcode 8.2 and OS 10.11.

6
  • #import or #include? (it should be #import) Commented Feb 18, 2017 at 18:48
  • @DDP both don't work. Commented Feb 18, 2017 at 21:32
  • And just to check also: this is a .m (objective-c) file not a .c? Commented Feb 18, 2017 at 21:54
  • @DDP it's a C. could not rename C to M. Commented Feb 19, 2017 at 7:50
  • 1
    Yes, renaming c->m in xcode helped! Commented Feb 19, 2017 at 8:07

1 Answer 1

1

Cocoa frameworks should be #import'd rather than #include'd. However, #import requires an Objective-C file (.m).

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.