I using the code from Apple for MailComposer but when I try to run my app i get a error message and I can't build my app.
The message error I get:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
objc-class-ref in InfoMailComposerViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Know anybody what this means??
thanks in advance
You have to include the MessageUI.framework in your project.
If you are using Xcode 4:
Select the Project then highlight your active Target.
Select the "Build Phases" Tab
Expand "Link Binary With Libraries"
Hit the '+' button
Select MessageUI.framework
The above answer by MarkPowell works like a charm.
I first tried it on the CordovaLib.xcodeproj file.
It did not work, then I tried it at Testing.xcodeproj. Then the errors disappeared and worked magically.
Related
I'm running Swift 4 and Xcode 9 beta. I get this errors and I have no idea how to solve it. I don't even know what does that mean..
Undefined symbols for architecture x86_64:
"__T0So22AVCapturePhotoSettingsC12AVFoundation01_abC16SwiftNativeTypesACWP", referenced from:
__T014InstagramClone26CustomCameraViewControllerC23cameraBtn_TouchUpInsideyypF in CustomCameraViewController.o
"__T012AVFoundation39_AVCapturePhotoSettingsSwiftNativeTypesPAAE016availablePreviewc11PixelFormatG0Says6UInt32VGfg", referenced from:
__T014InstagramClone26CustomCameraViewControllerC23cameraBtn_TouchUpInsideyypF in CustomCameraViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any idea how to solve this?
On my case, I've called settings = AVCapturePhotoSettings() and I got that error.
Eventually the solution was calling a different initialiser. i.e:
settings = AVCapturePhotoSettings(format: [AVVideoCodecKey : AVVideoCodecType.jpeg])
It looks like your project probably isn't linking against AVFoundation. Click on your project at the top of the Project Navigator, select your target, and click "Build Phases." In the "Link Binary with Libraries" phase, click the Add button, select AVFoundation from the list, and add it. This should cause your project to build normally.
I am new to iphone develop and phonegap also. Now i want to create simple iphone app using phonegap. Now i am using phonegap2.0 in lion mac. MY Xcode version is 4.3. Now my issue is after install the phonegap2.0 in xcode when i run the Xcode in my Simulator 5.0. I got this below error.
"Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CDVViewController", referenced from:
_OBJC_CLASS_$_ViewController in ViewController.o
objc-class-ref in AppDelegate.o
"_OBJC_METACLASS_$_CDVViewController", referenced from:
_OBJC_METACLASS_$_ViewController in ViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)"
Please help me to solve this issue. Thanks in Advance.
And i have attach the Screen Shot of error page for your reference.
Check if your project links libCordova.a (in my case Xcode forgot about the reference, when moving CordovaLib.xcodeproj to another location).
select your project in the Project Navigator
go to the Summary tab
drag CordovaLib.xcodeproj > Products > libCordova.a to Linked Frameworks and Libraries
Clean & build.
Please check your ViewController.m file and goto to
1. Build phase in xcode
2. Select Compile Sources
3. Press + button to add .m/.mm file
I think it will run successfully now
Remove armv7s from your build settings, for both your project and the referenced subproject Cordova. Set your target to 4.3.
I had a similar issue. Somehow my the NSManagedObject Sub-classes of my Core Data entities were in the Compile Sources table twice. The compiler would choke when it hit the first of these duplicates.
I just went into the Compile Sources table and deleted the second occurrence of each .m listing.
I get the following error when trying to compile my project in xcode 4 (worked fine in xcode 3.x)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_FBSession", referenced from:
objc-class-ref in View1Controls.o
"_OBJC_CLASS_$_FBLoginDialog", referenced from:
objc-class-ref in View1Controls.o
"_OBJC_CLASS_$_FBRequest", referenced from:
objc-class-ref in View1Controls.o
"_OBJC_CLASS_$_FBStreamDialog", referenced from:
objc-class-ref in View1Controls.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
Can anyone explain whats wrong? I'm sure I've correctly imported the header files..
Thanks,
Jack
Assuming the libraries with these functions are included in the Xcode project, this error occurs when the libraries are not linked with the binary executable file. This can happen when upgrading an older project to a newer version of Xcode.
To fix it navigate to the project overview in Xcode. Click on the target. Click on Build Phases. Expand the "Link Binary With Libraries" list. If libraries are not listed, click the "+", and add the appropriate libraries.
You are missing a library/framework which caused the linker errors that you see. I'm not sure which framework is associated with Facebook functionality, it might be the general network related one. Let me see if I can find out which you need.
EDIT: Do you have the Foundation framework included with your project? Does the Facebook site maybe mention which one you need?
I don't work with facebook, but here's my thoughts:
That's a linker error, not a compiler one (which it would be if the header weren't imported). Have you imported the correct framework? And ensured XCode is telling the compiler to link to the correct library?
Its related to linker error. So just remove facebook framework from project and drag new one.
Remove existing facebook framework
Drag FacebookSDK.framework folder from the SDK installation folder into the Frameworks section of your project
I have added the frameworks (MapKit and CoreLocation) by selecting the Frameworks folder, right clicking, Add > Existing Frameworks.
The app builds in the Simulator (3.1.3) but fails on the Device (3.1.3) with the error:
ld: warning: in
/Development/Sites/iPhone
Projects/SwitchViews/MapKit.framework/MapKit,
file is not of required architecture
Undefined symbols:
"_OBJC_CLASS_$_MKPinAnnotationView",
referenced from:
__objc_classrefs__DATA#0 in NextView.o ld: symbol(s) not found
collect2: ld returned 1 exit status
It seems that I just needed to restart Xcode to get things linked up properly.
It looks like you by accident have selected the "copy to project" checkbox when adding the framework.
Try to delete the framework from your project and add it again, making sure you have selected the default framework path, and that you don't copy it to your project.
I've been fighting this framework error for days now. I have included the MessageUI framework from the iphone3.0sdk and imported the header file(MessageUI/MessageUI.h)
Anyone know what this error means?
collect2: ld returned 1 exit status
symbol(s) not found
literal-pointer#_OBJC#__cls_refs#MFMailComposeViewController
".objc_class_name_MFMailComposeViewController", referenced from:
Here is some output from the build log:
ld warning: in /Users/me/iphone/myApp/MessageUI.framework/MessageUI, missing required architecture i386 in file
Undefined symbols:
".objc_class_name_MFMailComposeViewController", referenced from:
literal-pointer#__OBJC#__cls_refs#MFMailComposeViewController in myViewController.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
You forgot to link to the MessageUI.framework or you're linking to the wrong version.
Here's the right way to add frameworks:
Double-click your target
Select the main tab
Add the framework by pressing the plus-button in the frameworks section
Now you should be able to build for the simulator and the device.
Edit:
The warning from ld looks like you copied the MessageUI.framework from the simulator SDK to your project directory. Delete it and ld should find the right one (the one in your current SDK).
You accidentally copied the iPhone SDK Framework into your project directory (on disk). Open your project directory (where you keep the project on disk) and delete the iPhone SDK Framework directory.
Rebuild.