我在建立时不断收到弧线错误 [英] I keep getting an arc error when building

查看:98
本文介绍了我在建立时不断收到弧线错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

编辑,我的问题是我没有将类链接到我的项目.

EDIT My problem was that I didn't link a class to my project.

我正在开发一个基本上是终端应用程序的应用程序.当我尝试构建它时,出现构建错误.

I am working on an app that is basically a terminal app. When I try to build it I'm getting a build error.

    Ld /Users/evanstoddard/Library/Developer/Xcode/DerivedData/Highjack-anstcjvykrnniwbltvijvyvexirq/Build/Products/Debug-iphonesimulator/Highjack.app/Highjack normal i386
    cd /Users/evanstoddard/Desktop/Highjack
    setenv IPHONEOS_DEPLOYMENT_TARGET 6.0
    setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/evanstoddard/Library/Developer/Xcode/DerivedData/Highjack-anstcjvykrnniwbltvijvyvexirq/Build/Products/Debug-iphonesimulator -F/Users/evanstoddard/Library/Developer/Xcode/DerivedData/Highjack-anstcjvykrnniwbltvijvyvexirq/Build/Products/Debug-iphonesimulator -filelist /Users/evanstoddard/Library/Developer/Xcode/DerivedData/Highjack-anstcjvykrnniwbltvijvyvexirq/Build/Intermediates/Highjack.build/Debug-iphonesimulator/Highjack.build/Objects-normal/i386/Highjack.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/evanstoddard/Library/Developer/Xcode/DerivedData/Highjack-anstcjvykrnniwbltvijvyvexirq/Build/Products/Debug-iphonesimulator/Highjack.app/Highjack

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_XXFdHijacker", referenced from:
      objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

这是我的实现文件:

    //
//  ViewController.m
//  My Utility 2
//
//  Created by Evan Stoddard on 2/6/13.
//  Copyright (c) 2013 Evan Stoddard. All rights reserved.
//

#import "ViewController.h"
#import "XXFdHijacker.h"

@interface ViewController () <XXFdHijackerDelegate>
@property (weak, nonatomic) IBOutlet UITextView *loggingView;

@property (strong, nonatomic) XXFdHijacker *stdoutHijacker;
@property (strong, nonatomic) XXFdHijacker *stderrHijacker;

@property (strong, nonatomic) NSMutableString *contents;

@end // extension


@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Hijack standard out.
    self.stdoutHijacker = [XXFdHijacker hijackerWithFd: fileno(stdout)];
    setbuf (stdout, NULL);
    self.stdoutHijacker.delegate = self;
    [self.stdoutHijacker startHijacking];
    [self.stdoutHijacker startReplicating];

    // Hijack standard error
    self.stderrHijacker = [XXFdHijacker hijackerWithFd: fileno(stderr)];
    setbuf (stderr, NULL);
    self.stderrHijacker.delegate = self;
    [self.stderrHijacker startHijacking];
    [self.stderrHijacker startReplicating];

    self.contents = [NSMutableString string];

    NSLog (@"All Kids Love Log");

} // viewDidLoad

- (void) scrollToEnd {
    NSRange range = NSMakeRange (self.contents.length, 0);
    [self.loggingView scrollRangeToVisible: range];
} // scrollToEnd


- (void) hijacker: (XXFdHijacker *) hijacker  gotText: (NSString *) text {
    if (hijacker == self.stdoutHijacker) [self.contents appendString: @"stdout: "];
    if (hijacker == self.stderrHijacker) [self.contents appendString: @"stderr: "];

    [self.contents appendString: text];
    self.loggingView.text = self.contents;
    [self scrollToEnd];
} // hijacker

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end

如果您需要更多内容,我愿意发送我的xcode项目.

I'm willing to send my xcode project if you need to see more.

推荐答案

检查Xcode项目中的XXFdHijacker.m文件,打开实用程序"视图(Xcode的右侧面板),并确保目标"已为您的应用选中成员资格"复选框.它可能没有被编译,因此尝试链接时缺少符号

Check the XXFdHijacker.m file in your Xcode project, open the "Utilities" view (the right-hand panel of Xcode) and make sure that the "Target Membership" checkbox is checked for your app. It may not be being compiled, hence the missing symbol when trying to link

这篇关于我在建立时不断收到弧线错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆