Linker command error: 'ld: symbol(s) not found for architecture i386'

眉间皱痕 提交于 2019-11-30 01:37:08
iOS Test

Try these steps:

  1. Open your project in XCode.

  2. In left side window/panel of XCode click on your project name on top.

  3. Now select Target from right side panel of XCode.

  4. Select Build Phases from right panel's top. (here other option will be Build Settings, Build Rules)

  5. In the same panel open the "Compile sources", here check: are all the files (.m) listed? if not all files click on (+) sign in bottom to add (.m) files which is not in list

  6. As per your error it seems RssXmlParser not there, add this and compile again

It will work fine now.

don't see anybody suggesting to go to terminal and go to the directory where the project is and run

xcodebuild -verbose

to see detailed error and just reading the error helps a lot of the time

I realized I had to use the .xcworkspace file instead of the .xcodeproj file.

Product -> Clean then Product -> Run :)

In my case, I mistakenly created a new subclass of UIView with .h and .c files instead of .h and .m files. Changing the extensions was easy, but I didn't think to change the contents of the .m files. So my .h files had

#ifndef My_Project_MPMyView_h
#define My_Project_MPMyView_h

#import <UIKit/UIKit.h>

@interface MPMyView : UIView

@end

#endif

and my .m files incorrectly had

#include <stdio.h>

When I changed my .m files to

@interface MPMyView : UIView

@end

@implementation MPMyView

@end

The linker error was fixed.

I solved the same issue because I created components as separate projects. After adding the folders to the main project, I forgot to delete the .plist, .string and extra main.m files from the imported component group directories.

Deleting these solved my issue because the app was obviously getting conflicting build commands...

I encountered this error due to duplicate filenames (I had created NSManagedObjectContext subclasses automatically in core data through the editor menu).

As of XCODE 5.0, just quit and restart and xcode should recognize this and fix it for you if you click on the yellow warning in the left hand pane

A similar error just happened to me on Xcode 6.4. Seems like an Xcode bug.

My fix was to go to the ".o" file that caused the error, uncheck and recheck target memberships that you need.

I think it might be that you are trying to create two different .C file (with main function) in one project. C only allows you to have one main entrance every project.

I don't know how it worked.But i simply closed the xcode and open again by clicking xcworkspace file and worked for me. you may try hopefully this can solve your problem thank you.

Hold down alt . On the top toolbar go to

Product > clean build folder

Press "clean build folder" and wait for it to build and run. It should resolve any errors in the build file.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!