Question

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];
}
Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top