Dutchie432
Dutchie432

Reputation: 29160

iPhone - Strange Compile Errors

I have an iPhone (Xcode) Project that was working fine. Something must have been changed, because all of a sudden I am getting errors that pertain to NSLog, UIActionSheet, and several other items I have been using JUST FINE until now. What am I missing? Any assistance would be GREATLY appreciated!

Checking Dependencies

Ld /Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/Debug-iphonesimulator/iPhone_PNP.app/iPhone_PNP normal i386
    cd /Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP
    setenv MACOSX_DEPLOYMENT_TARGET 10.5
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.0.sdk -L/Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/Debug-iphonesimulator -F/Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/Debug-iphonesimulator -filelist /Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/iPhone_PNP.build/Debug-iphonesimulator/iPhone_PNP.build/Objects-normal/i386/iPhone_PNP.LinkFileList -mmacosx-version-min=10.5 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/markgoldberg/Documents/iPhoneApps/iPhone_PNP/build/Debug-iphonesimulator/iPhone_PNP.app/iPhone_PNP
Undefined symbols:
  ".objc_class_name_SettingsWindowViewController", referenced from:
      literal-pointer@__OBJC@__cls_refs@SettingsWindowViewController in iPhone_PNPAppDelegate.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Upvotes: 1

Views: 1503

Answers (4)

Rog
Rog

Reputation: 17170

You have not defined the class SettingsWindowViewController anywhere.

From your solution (remove SettingsWindowViewController.m from the project and re-add it) it looks like they were not included in the target's "compile sources" stage Ias suggested by cdespinosa). You can check this by opening the "compile Sources" twistie in the target item in the "Groups and Files" pane.

In addition to the methods cdespinosa suggests for setting target membership, you can aslo show an extra column with "target memebership" in the "groups and files" pane by left clicking on the header.

Upvotes: 1

cdespinosa
cdespinosa

Reputation: 20799

You resolved the problem, but you probably don't know why. It's probably important to know what was wrong and why doing what you did fixed it, so you can make it not happen again.

The problem was most likely that your SettingsWindowViewController.m file was not a member of the iPhone_PNP target you were building. Projects are just containers; targets actually build things, and if a file is in the project but not assigned to a target, it won't get built.

Removing the files and re-adding it defaulted to adding it to the current target. You might have seen a list with a check box in it and paid no attention to it, but that check box is what fixed the problem.

The easier way to do this in the future is to just drag the source file into the target, or choose Get Info on it and click the target's check box in the General tab.

Upvotes: 3

Dutchie432
Dutchie432

Reputation: 29160

OK - I found the problem from this URL: http://forums.macrumors.com/showthread.php?t=475818

I simply had to remove my SettingsWindowViewController.h & SettingsWindowViewController.m files from my project and re-add them. Problem resolved.

Thank you all!

Upvotes: 0

GoatRider
GoatRider

Reputation: 1213

Try a clean build.

Upvotes: 1

Related Questions