Build error when running unit test of Cocoa Library

I started AppCode Cocoa Library project named Second.
AppCode generates Second and SecondTests, and I could get Second.dylib.

However, when I build and run SecondTests unit test, I got this build error.

>> Undefined symbols for architecture x86_64:"_OBJC_CLASS_$_Second", referenced from:objc-class-ref in SecondTests.o
>> (maybe you meant: _OBJC_CLASS_$_SecondTests)
>> ld: symbol(s) not found for architecture x86_64

I have no problem with Cocoa Application in unit testing. What might be wrong?


Please try switching architecture in the run configuration to 32 bit.
Does it help?


In Run/Debug Configuration, I make Architecuter to 32-bit Intel for both Application and OCUnit.

When I excuted the build, I got error message - Error:Build Finished with Error: 65


Please create a bug report ( and, if possible attach a sample project.


Based on your answer from email :

You have a problem in the SecondTest target configuration: you need to add Second.dylib the the 'Link Binary with Libraries' section.

I opened XCode, and at Targets > BuildPhases > Link Binary With Libraries, I could add the dylib.
After the recompilation in XCode, I could reopen AppCode to make it work.

Is this correct procedure? Can't I set the configuration in AppCode?


That is correct.
No, at the moment the is no target configuration facilities in AppCode, please follow


Please sign in to leave a comment.