Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6577759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:40:47+00:00 2026-05-25T15:40:47+00:00

I am pretty new to OSX programming, or to the use of ObjC. I’ve

  • 0

I am pretty new to OSX programming, or to the use of ObjC. I’ve done a fair bit of C en C++ in the past, mainly in combination with VTK.
I am trying to compile a very simple program, where I copied an init method from Apple demo code. I am pretty sure I’m forgetting something. My project is a default Cocoa app, and I made a class MyRoster which for some reason causes linking problems. The output during compilation is the following (if anyone needs more, just say so):

Ld /Users/mark/Library/Developer/Xcode/DerivedData/Rooster-giqzgxqladmwyjepkqehtzkmuvyd/Build/Products/Debug/Rooster.app/Contents/MacOS/Rooster normal x86_64
cd /Users/mark/Documents/Programming/Rooster
setenv MACOSX_DEPLOYMENT_TARGET 10.7
/Developer/usr/bin/clang -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.7.sdk -L/Users/mark/Library/Developer/Xcode/DerivedData/Rooster-giqzgxqladmwyjepkqehtzkmuvyd/Build/Products/Debug -F/Users/mark/Library/Developer/Xcode/DerivedData/Rooster-giqzgxqladmwyjepkqehtzkmuvyd/Build/Products/Debug -filelist /Users/mark/Library/Developer/Xcode/DerivedData/Rooster-giqzgxqladmwyjepkqehtzkmuvyd/Build/Intermediates/Rooster.build/Debug/Rooster.build/Objects-normal/x86_64/Rooster.LinkFileList -mmacosx-version-min=10.7 -framework Cocoa -o /Users/mark/Library/Developer/Xcode/DerivedData/Rooster-giqzgxqladmwyjepkqehtzkmuvyd/Build/Products/Debug/Rooster.app/Contents/MacOS/Rooster

Undefined symbols for architecture x86_64:
"_CalEventsChangedNotification", referenced from:
  -[MyTasksCalendar init] in MyTasksCalendar.o
"_CalEventsChangedExternallyNotification", referenced from:
  -[MyTasksCalendar init] in MyTasksCalendar.o
"_OBJC_CLASS_$_CalCalendarStore", referenced from:
  objc-class-ref in MyTasksCalendar.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The base app compiles fine; the problem is this modified init method:

- (id)init
{
    self = [super init];
    if (self) {
        // Add the receiver as an observer of Calendar Store notifications
        [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(eventsChanged:) name:CalEventsChangedExternallyNotification object:[CalCalendarStore defaultCalendarStore]];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(eventsChanged:) name:CalEventsChangedNotification object:[CalCalendarStore defaultCalendarStore]];

    // Create a predicate to use to fetch the events
    NSInteger year = [[NSCalendarDate date] yearOfCommonEra];
    startDate = [[NSCalendarDate dateWithYear:year month:1 day:1 hour:0 minute:0 second:0 timeZone:nil] retain]; 
    endDate = [[NSCalendarDate dateWithYear:year month:12 day:31 hour:23 minute:59 second:59 timeZone:nil] retain]; 
    NSPredicate *eventsForThisYear = [NSPredicate eventPredicateWithStartDate:startDate endDate:endDate calendars:[[CalCalendarStore defaultCalendarStore] calendars]];

    // Fetch all events for the current year
    events = [[NSMutableArray array] retain];
    [self addEventArray:[[CalCalendarStore defaultCalendarStore] eventsWithPredicate:eventsForThisYear]];
    }
    return self;
}

My question: why would this not link? The called methods are in standard Apple libraries, so what gives?

Many thanks,

Mark

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T15:40:48+00:00Added an answer on May 25, 2026 at 3:40 pm

    It looks like you’re missing the CalendarStore framework from your project – try adding /System/Library/Frameworks/CalendarStore.framework to your project.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm still pretty new to ObjC. I noticed that it's pretty standard everywhere to
I am pretty new to buddypress. I am trying to do something pretty simple
Pretty new to dependency injection and I'm trying to figure out if this is
Pretty new to sqlite (and sql). Trying to modify one table using another. create
I'm pretty new to programming, so this should be an easy one. I'm switching
I'm pretty new to Python programming so I have this question: How can I
Pretty new to C# (and I would describe myself as a beginner in programming,
I am pretty new to programming and I want to know how to detect
I'm pretty new to Perl/HTML. Here is what I'm trying to do with WWW::Mechanize
Pretty new to Prolog. I'm trying to give two lists and have the difference

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.