简体   繁体   English

Xcode项目中的链接器错误

[英]linker error in Xcode project

I am getting the following linker error: 我收到以下链接器错误:

Undefined symbols for architecture i386:
  "_OBJC_CLASS_$_Message", referenced from:
      objc-class-ref in DetailsViewController.o
     (maybe you meant: _OBJC_CLASS_$_Messages)
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

How do I remove this? 我该如何删除? I checked in my DetailsViewController.m and I don't have any Message class anywhere in there 我签入了DetailsViewController.m,那里没有任何Message类

UPDATE: 更新:

Before this I had a warning: (this was caused because I added ShareKit into my project) 在此之前,我有一个警告:(这是由于我将ShareKit添加到项目中引起的)

objc[59714]: Class Message is implemented in both /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/PrivateFrameworks/MIME.framework/MIME and /Users/aditya15417/Library/Application Support/iPhone Simulator/4.3.2/Applications/4EFD7570-AD87-48E8-8606-1D5633F65AD9/CTest.app/CTest. One of the two will be used. Which one is undefined.

As suggested by one guy from SO, I need to append the Message class with some other prefix.Therefore I changed the class name of Message to CVMessage everywhere in my class (basically whenever I see Messsage I'd replace it with CVMessage) and then I got this error 正如SO的一个人所建议的那样,我需要在Message类的后面加上其他前缀,因此我在类中的每个地方都将Message的类名更改为CVMessage(基本上每当我看到Messsage时都将其替换为CVMessage),然后我得到这个错误

检查DetailsViewController是否在目标的“ Compile Sources中。

Run the static analyzer, and see if there are warnings in that file. 运行静态分析器,然后查看该文件中是否有警告。

You are referencing Messages somewhere in there, even if all you are doing is making use of a call somewhere that's supposed to return a Message class... 您正在那里引用某个地方的Messages,即使您所做的只是利用应该返回Message类的某个地方的调用...

You must have a Message class somewhere in your project, check and see if that is being compiled by your target. 您的项目中的某处必须有一个Message类,检查并查看目标是否正在编译该类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM