kiwi-bdd / Kiwi

Simple BDD for iOS
BSD 3-Clause "New" or "Revised" License
4.14k stars 512 forks source link

Undefined symbols for architecture x86_64: #666

Closed action456789 closed 8 years ago

action456789 commented 8 years ago

I just code as follows:

SPEC_BEGIN(MathSpec)

describe(@"Person name is", ^{
    it(@"Tom", ^{
        KSPerson *person = [KSPerson new];
        [person stub:@selector(name) andReturn:@"Tom"];
        NSString *testName = [person name];
        [[testName should]equal:@"Tom"];
    });
});

SPEC_END
Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_KSPerson", referenced from:
      objc-class-ref in KiwiDemoTests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
modocache commented 8 years ago

Thanks for the report, @action456789! It looks like there's a linker error for KSPerson -- this isn't a Kiwi class, this is probably something in the library or app you are testing. Are you sure you've linked our library or app to your test bundle? This is normally done automatically by Xcode when starting a new project, or adding a new test target.

I don't think this is a Kiwi issue, so I'll close this for now. :)