代码之家  ›  专栏  ›  技术社区  ›  Dutchie432

iPhone-奇怪的编译错误

  •  1
  • Dutchie432  · 技术社区  · 17 年前

    NSLog , UIActionSheet 很好 直到现在。我错过了什么?任何帮助都将不胜感激!

    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
    
    4 回复  |  直到 17 年前
        1
  •  3
  •   cdespinosa Martin Cote    17 年前

    你解决了问题,但你可能不知道为什么。知道什么地方出了问题以及为什么要这么做是很重要的,这样你才能避免再次发生。

    问题很可能是您的SettingsWindowViewController.m文件不是您正在构建的iPhone\u PNP目标的成员。项目只是容器;目标实际上构建了一些东西,如果项目中有一个文件,但没有分配给目标,则无法构建该文件。

    将来更简单的方法是将源文件拖到目标文件中,或者选择“获取有关它的信息”并单击“常规”选项卡中目标文件的复选框。

        2
  •  1
  •   GoatRider    17 年前

        3
  •  1
  •   Rog    17 年前

    您尚未定义该类 SettingsWindowViewController 在任何地方

    SettingsWindowViewController.m 从项目中重新添加)看起来它们没有包含在cdespinosa建议的目标的“编译源代码”阶段(Ias)。您可以通过在“组和文件”窗格的目标项中打开“编译源代码”twistie来检查这一点。

    除了cdespinosa建议的设置目标成员身份的方法外,您还可以通过左键单击标题在“组和文件”窗格中显示一个额外的列,其中包含“target memebership”。

        4
  •  0
  •   Dutchie432    17 年前

    http://forums.macrumors.com/showthread.php?t=475818

    我只需删除我的设置SwindowViewController.h&从我的项目中设置SwindowViewController.m文件并重新添加它们。问题解决了。

    谢谢大家!!