Can't seem to import QuartzCore.h correctly

  • This may be a complete newb question but I'm absolutely stuck on how
    to fix this.  I've got a subclass of NSView.  In its interface file I
    have the following lines:

    #import <Cocoa/Cocoa.h>
    #import <QuartzCore/QuartzCore.h>

      Then in my implementation file I import the interface file with.

    #import "mySubView.h"

    Then in XCode, I have added the QuartzCore framework to the
    frameworks folder (it's sitting right next to the Cocoa framework
    under 'linked frameworks').  Now if I try something like this in my
    implementation file:

    CIContext *newCIContext;

    I'll receive an error during build: "error: 'CIContext' undeclared
    (first use in this function)".

    Any ideas what I'm doing wrong??  Thanks in advance.

    ----------------------------------
    Carter R. Harrison
    <carterharrison...>
    ----------------------------------
  • On Oct 22, 2006, at 5:35 AM, Carter R. Harrison wrote:

    > This may be a complete newb question but I'm absolutely stuck on how
    > to fix this.  I've got a subclass of NSView.  In its interface file
    > I have the following lines:
    >
    > #import <Cocoa/Cocoa.h>
    > #import <QuartzCore/QuartzCore.h>

    That should work, but what happens if you import Qartz/Quartz.h instead?

    -jcr
  • Just out of curiosity, I created a new project with a view subclass in
    it, and declared a CIContext as an ivar:

    #import <Cocoa/Cocoa.h>

    @interface MyView : NSView {
    CIContext *theContext;

    }

    @end

    #import "MyView.h"

    @implementation MyView

    - (void)drawRect:(NSRect)rect {
    [[NSColor blueColor] set];
    NSRectFill(rect);
    }

    @end

    No problem building and running it.

    Note that I didn't need to import Quartz or QuartzCore, they were
    picked up by importing Cocoa.h.

    -jcr
  • I haven't spent the time to check but could this be an issue with the
    settings of my build target?  Since CoreImage is in 10.4 only, and my
    target was configured to run on 10.3 and up, is it possible that the
    compiler would not let me declare core image types since they do not
    exist in 10.3?  I was importing the 10.4 QuartzCore framework, but I
    noticed that if you look at the 10.3.9 QuartzCore framework,
    quartzcore.h includes coreimage.h, but then if you look at
    coreimage.h it is entirely empty (for obvious reasons).  Any other
    thoughts?

    ----------------------------------
    Carter R. Harrison
    <carterharrison...>
    ----------------------------------

    On Oct 22, 2006, at 9:55 AM, John C. Randolph wrote:

    >
    > Just out of curiosity, I created a new project with a view subclass
    > in it, and declared a CIContext as an ivar:
    >
    >
    > #import <Cocoa/Cocoa.h>
    >
    > @interface MyView : NSView {
    > CIContext *theContext;
    >
    > }
    >
    > @end
    >
    > #import "MyView.h"
    >
    >
    > @implementation MyView
    >
    > - (void)drawRect:(NSRect)rect {
    > [[NSColor blueColor] set];
    > NSRectFill(rect);
    > }
    >
    > @end
    >
    >
    > No problem building and running it.
    >
    > Note that I didn't need to import Quartz or QuartzCore, they were
    > picked up by importing Cocoa.h.
    >
    > -jcr
    >
  • On Oct 22, 2006, at 11:13 AM, Carter R. Harrison wrote:

    > I haven't spent the time to check but could this be an issue with
    > the settings of my build target?  Since CoreImage is in 10.4 only,
    > and my target was configured to run on 10.3 and up, is it possible
    > that the compiler would not let me declare core image types since
    > they do not exist in 10.3?

    Yep, that would do it, all right.

    -jcr
previous month october 2006 next month
MTWTFSS
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          
Go to today