Apple Mach-O Linker (id) Error - undefined symbols for architecture i386
Asked Answered
S

1

12

I know this type of error has been raised many times before, but I have not found solution of my error. I am using xcode 4.0. I downloaded ASIHTTPRequest zip and copied classes folder along with two files of 'Reachability". After compilation, it is giving me strange errors which I can't figure out. Below I copied text of error for undefined symbols for architecture i386.

Ld /Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Products/Debug-iphonesimulator/Manual.app/Manual normal i386
cd "/Users/svp/Desktop/Manual nav before pres 2"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Products/Debug-iphonesimulator -F/Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Products/Debug-iphonesimulator -filelist /Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Intermediates/Manual_BeforePres2.build/Debug-iphonesimulator/Manual.build/Objects-normal/i386/Manual.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lz -framework SystemConfiguration -framework CFNetwork -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/svp/Library/Developer/Xcode/DerivedData/Manual_BeforePres2-fahkeiivemkgpubswgvzglvndszw/Build/Products/Debug-iphonesimulator/Manual.app/Manual

 Undefined symbols for architecture i386:
"_UTTypeCreatePreferredIdentifierForTag", referenced from:
  +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_UTTypeCopyPreferredTagWithClass", referenced from:
  +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_kUTTagClassFilenameExtension", referenced from:
  +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
"_kUTTagClassMIMEType", referenced from:
  +[ASIHTTPRequest mimeTypeForFileAtPath:] in ASIHTTPRequest.o
ld: symbol(s) not found for architecture i386

collect2: ld returned 1 exit status

Also it is giving me a warning in ASIAuthenticationDialog.m file:

ASIAuthenticationDialog may not respond to _presentingViewController

Please anyone tell me what are these errors and warning for? What am I doing wrong? I have wasted many hours over it :(

EDIT:

Code for warning in ASIAuthenticationDialog.m file:

#import "ASIAuthenticationDialog.h"
#import "ASIHTTPRequest.h"

#pragma mark show / dismiss

+ (void)dismiss
{
if ([sharedDialog respondsToSelector:@selector(presentingViewController)])
    [[sharedDialog presentingViewController] dismissModalViewControllerAnimated:YES];
else 
    [[sharedDialog parentViewController] dismissModalViewControllerAnimated:YES];
}
Screamer answered 18/7, 2012 at 19:50 Comment(0)
D
36

If you were to look up the missing symbols in the documentation, you would find them listed along with the framework where they are located. For example, UTTypeCreatePreferredIdentifierForTag says it is located in the MobileCoreServices.framework. (The others may be there too; I didn't look for all of them.) Add the necessary framework(s) to the link library step of your target's build phases and the symbols should be resolved.

As for the warning, please show the code where it's happening.

Drachma answered 18/7, 2012 at 20:58 Comment(5)
My first part has been solved by adding framework. Thank you very much! I have edited my Question to include warning code.Screamer
I have just shown the warning part, omitting the rest of code.Screamer
Are you sure there's a property called exactly presentingViewController declared in ASIAuthenticationDialog.h? (If yes, what class is sharedDialog defined as being? If it's not ASIAuthenticationDialog, you may have to cast it.)Drachma
@satheeshwaran Please note that whether the answer was effective is a reasonable comment, not part of the answer.Drachma
@PhillipMills Whatever bro, I thought one look at that statement would help others to solve this error. No worries.Broker

© 2022 - 2024 — McMap. All rights reserved.