开发者

Xcode: ld: symbol(s) not found but both classes are there [closed]

开发者 https://www.devze.com 2023-04-11 12:35 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 10 years ago.

I'm getting the following message error:

".objc_class_name_ClassA", referenced from:
literal-pointer@__OBJC@__cls_refs@CBLookupItemBook in ClassB.o
ld: symbol(s) not found

But both classA and classB are in the target Compile Sources.

I've cleaned, deleted the build folder, and restarted Xcode. Still t开发者_Go百科he same issue.


Checked that the files containing the classes are part of the target you are trying to compile. View > Utilities > Show File Inspector, Target Membership in the right inspector panel.


There was a misspelling in the class name... not sure why the compiler didn't complain about it


For Xcode 4, if you're having this issue, you may want to click on your project -> target -> build phases -> compile sources. Verify that the missing class is actually being compiled. If it isn't, press the plus button at the end of the list and add it. I had this problem when I trashed a class (because it was based off of a UIViewController but I wanted to base it off of a UITableViewController) and then added another class with the same name. It seemed Xcode was tripped up by that and didn't automatically add the class to be compiled.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号