Using iphone-exif for EXIF data - iphone

I want to use iphone-exif library for EXIF data in my proj. But i dont know if i done any mistake or not it gives error like
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_EXFJpeg", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture i386
please give some solution for that.
Thanks in advance for ur answers.

Instead of using that library Please go through this Solution
Actually I had the same problem so I had created it for myself for getting EXIF info purpose..

When you download iPhone-exif your will find two precompiles libraries.
Release-iphoneos/libiphone-exif.a
Release-simulator-iphonesimulator/libiphone-exif.a
Depending on where you'd like to run your app, you need to link against the right file.
You probably added Release-iphoneos/libiphone-exif.a to your project and then you tried to run in on the Simulator (i386 architecture!).
Easiest way:
Create a universal library of the both above.
Open terminal
Cd to your iphone-ex download folder (cd iphone-exif-0-9)
lipo -arch i386 Release-simulator-iphonesimulator/libiphone-exif.a -arch armv6 Release-iphoneos/libiphone-exif.a -create -output libiphone-exif-universal.a
add the file "libiphone-exif-universal.a" to your Xcode project
But i've just found out that there is a armv7 build missing. If you'd like to place your app on the appstore you once need also to build the library also for armv7 (out of the sources!)

Related

ignoring file [path] missing required architecture i386 in file

I'm quite new to Xcode and Iphone development and ran into the following problem:
I opened a new project and added *.h and a *.a files (which I recived from a certain device vendor).
I get the following warning:
ld: warning: ignoring file /Users/udi/Desktop/Xcode/Xcode Projects/Scosche/libmyTrekSDK_armv7.a, missing required architecture i386 in file /Users/udi/Desktop/Xcode/Xcode Projects/Scosche/libmyTrekSDK_armv7.a (2 slices)
If I ignore the warning, and try to instanciate the class that is given to me in the header file, I get these errors:
ld: warning: ignoring file [Path/FileName.a], missing required architecture i386 in file [Path/FileName.a] (2 slices)
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_HRMonitor", referenced from:
objc-class-ref 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)
I've checked the Framework Search Pathes (as mantioned in many other posts) and it clear.
More info:
I'm Using Xcode 4.6.1
The files are currently located at project's root folder.
I'm using a Single View Application tamplate.
Appreciate any help
This warning means that you're trying to use library made for Device (ARM) with your Simulator (i386).
You can use this terminal command to create a universal library:
lipo -create lib_arm.a lib_i386.a -output lib_universal.a
More info about lipo command here.
Change your target's "Build Settings > Build Active Architectures Only" to "No"
This is doing the same thing as Dmitry Zhukov's answer but doing it thru Xcode instead of going around its back.
If you are working with a 3rd party code, keep in mind that some SDKs may not work on the simulator. The same build error I have encountered vanished, when I ran the project on the device.

iPhone Static Library Issues With Simulator

So I have an iPhone static library that I am trying to build. I've got the script that was used in this question (http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4), but the issue I've hit is that I'm seemingly still unable to successfully build the static library for the simulator. When I build in the static library project, I get the follow warnings:
warning: no rule to process file '$(PROJECT_DIR)/GDInAppStore/GDInAppStore.m' of type sourcecode.c.objc for architecture i386
warning: no rule to process file '$(PROJECT_DIR)/GDInAppStore/SKProduct+priceAsString.m' of type sourcecode.c.objc for architecture i386
warning: no rule to process file '$(PROJECT_DIR)/GDInAppStore/VerificationControllerPBK.m' of type sourcecode.c.objc for architecture i386
I believe this issue is causing the problem that is leading to the universal library I get from the build script causing this error in my other project
ld: warning: ignoring file /Users/abotkin/Projects/Static Libraries/GDInAppStore/libGDInAppStore.a, missing required architecture i386 in file
"_OBJC_CLASS_$_GDInAppStore", referenced from:
objc-class-ref in SubscribeNowInAppController.o
ld: symbol(s) not found for architecture i386
I'm using Xcode 4.3.2 and have set the flags in the static library Xcode project so that i386 is included in the Architecture and Valid Architectures. Any tips?
Make sure you are building for the simulator if you are compiling for i386. Basically, your arch parameter has to match your sdk parameter. i.e.
xcodebuild -project proj.xcodeproj -arch armv64 -sdk iphoneos8.1 build
and
xcodebuild -project proj.xcodeproj -arch i386 -sdk iphonesimulator8.1 build
I was able to do a workaround this issue by using Karl's iOS Universal Framework that he mentioned in the other topic here https://stackoverflow.com/a/5721978/497718
That said, if anyone could point me into what I may have been doing wrong in using the script in that same topic, I'd love to learn how to do it the right way.
With Xcode 6, Apple has added iOS framework support to their build tools.
Using Apple's framework target for all new projects, as it is less hacky and is supported by Apple themselves.

OBJC_CLASS_$_MTSCRA", referenced from

I was trying to make a sample code run download by the link
http://www.magtek.com/support/software/downloads/sw/99510108.zip
This is a card reader api ,here is a sample code.When I run this code I got the error:
ld: warning: ignoring file /Users/gaurav.garg/Downloads/99510108/SampleCode/Lib/libMTSCRA.a, missing required architecture i386 in file
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MTSCRA", referenced from:
objc-class-ref in MagTekDemoAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The class MTSCRA is only a header file,And the solution that I have cheked That we have to add the .m file in compiled source path of build build phase of target...but unfortunately I don't have the MTSCRA.m file.MTscra.h have the AudioToolBox and externalAccesory framework.
Actually the problem is that MagTek provides you two separate .a files.
If you look at the one in the Release-iphoneos and run the following command:
> lipo -info libMTSCRA.a
Architectures in the fat file: libMTSCRA.a are: armv7 (cputype (12) cpusubtype (11))
Likewise if you look at the one in Release-iphonesimulator...
> lipo -info libMTSCRA.a
input file libMTSCRA.a is not a fat file
Non-fat file: libMTSCRA.a is architecture: i386
So the real answer is to create a new libMTSCRA.a for DEBUG that is n-way FAT by combining the two using lib tool and then creating separate DEBUG and RELEASE library search paths.
To start you would go to the directory above where MagTek keeps the two different versions of libMTSCRA.a When you are there, you will run the following command:
libtool -static -o libMTSCRA_FAT.a Release-iphoneos/libMTSCRA.a Release-iphonesimulator/libMTSCRA.a
When you examine the output file, you should see:
>lipo -info libMTSCRA_FAT.a
Architectures in the fat file: libMTSCRA.a are: armv7 (cputype (12) cpusubtype (11)) i386
Then in your project, create two folders (aka groups) "debug" & "release" and then restructure the DEBUG and RELEASE Library Search Paths to use these respective directories.
Lastly, rename libMTSCRA_FAT.a to libMTSCRA.a and place it in the debug search path keeping the iOS (armv7 (cputype (12) cpusubtype (11))) in release. The reason we do this is because while it might be ok to use this newly created .a file in debug mode it is considered bad taste to push this into production because we have no way to confirm that the merged lib is 100% what we intended ( the merge of the archs ).
Et voilĂ  !
Undefined symbols for architecture i386:
It means that the library you are linking against does not have symbols for i386. Which means you can not use the simulator. You will need to run the sample on the device or get the version of the library created for the simulator.
You need to make sure you are including all of the Frameworks that are required by that library.

Simple Torch Application in XCode

I am trying to build a simple torch application for iOS 5 as described in http://developer.apple.com/library/mac/releasenotes/AudioVideo/RN-AVFoundation/_index.html#//apple_ref/doc/uid/TP40010717-CH1-DontLinkElementID_17 but i am getting "Apple Match-O Linker Error:
Undefined symbols for architecture armv7:
"_AVMediaTypeVideo", referenced from:
-[FirstViewController viewDidLoad] in FirstViewController.o
"_OBJC_CLASS_$_AVCaptureDevice", referenced from:
objc-class-ref in FirstViewController.o
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Any help appreciated
Anybody ?
Additionally: it only happens when running the project, no errors if i just clean & Build, and the code completion detects the library.
Thanks
You might need to link your project with the AVFoundation framework first.
If you're already doing that, make sure you're building for armv7 and not just armv6.
Check it in your project settings > Target > Build Settings > Architecture
As simple as this:
Linker errors like this indicate that a symbol is missing when the app is being linked. Most system symbols like these, come from system frameworks. So, I was missing a framework in my project that contains AVCaptureDevice and AVMediaTypeVideo.
To solve it, i just added the AVFoundation framework following this tutorial: http://www.thinketg.com/Company/Blogs/11-03-20/Xcode_4_Tips_Adding_frameworks_to_your_project.aspx
Now it runs !

Xcode Static librari error ignoring file , file was built for archive which is not the architecture being linked (armv6)

i get this error when i am trying to use my compiled static library in my iphone aplication. I have no frigging idea what's wrong.
ld: warning: ignoring file /Users/rw/Library/Developer/Xcode/DerivedData/MSTicketingSaaS-gkznscznevvifjesoapzgwycbces/Build/Products/Debug-iphoneos/libMylib.a, file was built for archive which is not the architecture being linked (armv6)
Undefined symbols for architecture armv6:
"_OBJC_CLASS_$_AppData", referenced from:
It worked before upgrading to Xcode 4.0.2
I added the i386 architecture and now it compiles for the simulator but NOT for the device.
Check with lipo which is the architecture your lib has been built for:
lipo -info <path_to_lib>
If it does not contain "arm6" then you should go back to the library project and build it for the proper architecture. If this does not help, please, give more detail about the structure of your project(s).