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 (youtrack.jetbrains.net/issues/OC#newissue=yes) and, if possible attach a sample project.
Done, I also uploaded my project.
http://youtrack.jetbrains.net/issue/OC-2753?projectKey=OC
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 http://youtrack.jetbrains.net/issue/OC-561.