linking error Ipad - ios

Hi am having this error when I am trying to compile my application. Can any one please let me what this error is?
Thanks
Ld /Users/DineshParchuri/Library/Developer/Xcode/DerivedData/Graph_Theory-bxoahqkbiemabledhmfyzkqpotjr/Build/Products/Debug-iphonesimulator/Graph_Theory.app/Graph_Theory normal i386
cd "/Users/DineshParchuri/Desktop/3:28:11/Graph_Theory"
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/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/DineshParchuri/Library/Developer/Xcode/DerivedData/Graph_Theory-bxoahqkbiemabledhmfyzkqpotjr/Build/Products/Debug-iphonesimulator -F/Users/DineshParchuri/Library/Developer/Xcode/DerivedData/Graph_Theory-bxoahqkbiemabledhmfyzkqpotjr/Build/Products/Debug-iphonesimulator -filelist /Users/DineshParchuri/Library/Developer/Xcode/DerivedData/Graph_Theory-bxoahqkbiemabledhmfyzkqpotjr/Build/Intermediates/Graph_Theory.build/Debug-iphonesimulator/Graph_Theory.build/Objects-normal/i386/Graph_Theory.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -o /Users/DineshParchuri/Library/Developer/Xcode/DerivedData/Graph_Theory-bxoahqkbiemabledhmfyzkqpotjr/Build/Products/Debug-iphonesimulator/Graph_Theory.app/Graph_Theory
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MyTableCell", referenced from:
objc-class-ref in Graph_TheoryViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status

The error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MyTableCell", referenced from:
objc-class-ref in Graph_TheoryViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
specifies that an Objective-C class named MyTableCell is not (completely) defined and a call to this undefined class is made in Graph_TheoryViewController.m
Check the Graph_TheoryViewController.m file and see if you implemented MyTableCell if you have (I assume) class with that name defined in one of the included headers.
If this class is declared elsewhere, you may be missing method implementations in the appropriate .m file (most likely MyTableCell.m)

This very same error drove me to the brink of insanity when I tried to include GData XML into one of my apps. The cause of the problem was that I included GDataXMLNode.h in my apps pch file - see my SO question.
If you're trying the same (using GData XML) this might be your solution, too. If not, try commenting out stuff in your pch file anyway - to be honest, I still don't know the exact logic behind this error, any explanations welcome...

Related

CocoaPods How to add a custom Subclass of a Framework in a Podfile to a CocoaPods framework

I am trying to subclass AFHTTPRequestOperation from AFNetworking for error handling in an SDK I am creating for an API. The subclasses are created in the Pod/Classes folder in Finder where the other .h and .m files of mine from my CocoaPods framework are stored. The framework was created per this method http://guides.cocoapods.org/making/using-pod-lib-create.html.
When I attempt to create a new Cocoa Touch Class as a subclass of the aforementioned AFNetworking classes and add its corresponding .h and .m files to the Pods/Classes destination, I get these errors:
Ld /Users/bryanboyko/Desktop/XCode/1StudentBody_iOS_Framework/Example/Build/Products/Debug-iphonesimulator/OSB-iOS-SDK.bundle/OSB-iOS-SDK normal i386
cd /Users/bryanboyko/Desktop/XCode/1StudentBody_iOS_Framework/Example/Pods
export IPHONEOS_DEPLOYMENT_TARGET=7.1
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.1.sdk -L/Users/bryanboyko/Desktop/XCode/1StudentBody_iOS_Framework/Example/Build/Products/Debug-iphonesimulator -F/Users/bryanboyko/Desktop/XCode/1StudentBody_iOS_Framework/Example/Build/Products/Debug-iphonesimulator -filelist /Users/bryanboyko/Desktop/XCode/1StudentBody_iOS_Framework/Example/Build/Intermediates/Pods.build/Debug-iphonesimulator/OSB-iOS-SDK.build/Objects-normal/i386/OSB-iOS-SDK.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.1 -Xlinker -dependency_info -Xlinker /Users/bryanboyko/Desktop/XCode/1StudentBody_iOS_Framework/Example/Build/Intermediates/Pods.build/Debug-iphonesimulator/OSB-iOS-SDK.build/Objects-normal/i386/OSB-iOS-SDK_dependency_info.dat -o /Users/bryanboyko/Desktop/XCode/1StudentBody_iOS_Framework/Example/Build/Products/Debug-iphonesimulator/OSB-iOS-SDK.bundle/OSB-iOS-SDK
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AFHTTPRequestOperation", referenced from:
_OBJC_CLASS_$_OSBRequestOperation in OSBRequestOperation.o
"_OBJC_CLASS_$_AFHTTPRequestOperationManager", referenced from:
_OBJC_CLASS_$_OSBRequestOperationManager in OSBRequestOperationManager.o
"_OBJC_CLASS_$_AFHTTPResponseSerializer", referenced from:
objc-class-ref in OSBRequestOperation.o
"_OBJC_METACLASS_$_AFHTTPRequestOperation", referenced from:
_OBJC_METACLASS_$_OSBRequestOperation in OSBRequestOperation.o
"_OBJC_METACLASS_$_AFHTTPRequestOperationManager", referenced from:
_OBJC_METACLASS_$_OSBRequestOperationManager in OSBRequestOperationManager.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld: symbol(s) not found for architecture i386
If I create the subclasses outside of the Pods target and in the target of an XCode project that I have installed my pods framework in, there are no errors. Because it works in this case, I am assuming that my subclasses in Pod/Classes folder that are a part of my CocoaPods framework do not have access to the AFNetworking framework that is incorporated via the Podfile.
Would love some help!
You definitely don't want to be creating subclasses where your CocoaPods are because it could lead to problems when you're installing/updating the pods. Keep the subclass in your own project (after all, it is your own file, not theirs).
If you're trying to create a subclass of a public class in the pod, you can create the subclass in your own project.
If you're trying to create a subclass of a class that's private or internal in the pod, I'd first recommend evaluating whether this is both functionality you want to add and that this is the design pattern you want to use. If you decide yes to both, you should create a fork of the repo, make the changes you want in your fork, then update your Podfile to use your forked version of the pod.

xcode 6 - symbols not found for architecture i386 (zbar)

I have a project which uses the zbar-sdk (a barcode scanning library).
After updating my machine to xcode 6 I am having some trouble.
Please help me solve this.
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ZBarReaderViewController", referenced from:
objc-class-ref in MenuListViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
you have to import AVFoundation and AudioToolbox frameworks and also set i386 armv6 armv7 armv7s architectures needed for running the libraries

Trouble compiling libnet 1.1.7 for iOS7

I'm trying to use libnet 1.1.7 in iOS project and i'm getting some errors:
Ld /Users/admin/Library/Developer/Xcode/DerivedData/net_tools-gnkjrfjgtxkpesepyzzpunpfdwkx/Build/Products/Debug-iphonesimulator/net_tools.app/net_tools normal i386
cd /Users/admin/Desktop/net_tools
setenv IPHONEOS_DEPLOYMENT_TARGET 7.0
setenv PATH "/Applications/Разработка/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Разработка/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Applications/Разработка/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Разработка/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -L/Users/admin/Library/Developer/Xcode/DerivedData/net_tools-gnkjrfjgtxkpesepyzzpunpfdwkx/Build/Products/Debug-iphonesimulator -L/usr/local/lib -F/Users/admin/Library/Developer/Xcode/DerivedData/net_tools-gnkjrfjgtxkpesepyzzpunpfdwkx/Build/Products/Debug-iphonesimulator -filelist /Users/admin/Library/Developer/Xcode/DerivedData/net_tools-gnkjrfjgtxkpesepyzzpunpfdwkx/Build/Intermediates/net_tools.build/Debug-iphonesimulator/net_tools.build/Objects-normal/i386/net_tools.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -lnet -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=7.0 -framework CoreGraphics -framework UIKit -framework Foundation -Xlinker -dependency_info -Xlinker /Users/admin/Library/Developer/Xcode/DerivedData/net_tools-gnkjrfjgtxkpesepyzzpunpfdwkx/Build/Intermediates/net_tools.build/Debug-iphonesimulator/net_tools.build/Objects-normal/i386/net_tools_dependency_info.dat -o /Users/admin/Library/Developer/Xcode/DerivedData/net_tools-gnkjrfjgtxkpesepyzzpunpfdwkx/Build/Products/Debug-
ld: warning: ignoring file /usr/local/lib/libnet.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libnet.dylib
Undefined symbols for architecture i386:
"_libnet_addr2name4", referenced from:
-[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
"_libnet_addr2name6_r", referenced from:
-[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
"_libnet_destroy", referenced from:
-[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
"_libnet_init", referenced from:
-[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
"_libnet_name2addr4", referenced from:
-[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
"_libnet_name2addr6", referenced from:
-[AppDelegate application:didFinishLaunchingWithOptions:] in AppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This is my simple code in AppDelegate.m:
#import "AppDelegate.h"
#import <libnet.h>
#implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
libnet_t *lnet;
char errbuf[LIBNET_ERRBUF_SIZE];
u_int32_t addr;
struct libnet_in6_addr addr6;
char ipv6addr[64];
char addr_str[] = "www.google.com";
lnet = libnet_init(LIBNET_RAW4, NULL, errbuf);
if ( lnet == NULL ) {
NSLog(#"libnet_init() failed: %s", errbuf);
exit(EXIT_FAILURE);
}
//IPv4
addr = libnet_name2addr4(lnet, addr_str, LIBNET_RESOLVE);
NSLog(#"%s",libnet_addr2name4(addr, LIBNET_DONT_RESOLVE));
//IPv6
addr6 = libnet_name2addr6(lnet, addr_str, LIBNET_RESOLVE);
libnet_addr2name6_r(addr6, LIBNET_DONT_RESOLVE, ipv6addr,
sizeof(ipv6addr));
NSLog(#"%s",ipv6addr);
libnet_destroy(lnet);
return YES;
}
#end
Can anyone please explain the error to me in detail, and how to rectify it? Any help would be much appreciated.
P.S. I use Xcode 5.0.1 on Mavericks (v10.9.4)
UPD. I'v rebuild libnet for i386 arch from source and i'v got only one error:
ld: building for iOS Simulator, but linking against dylib built for MacOSX file '/usr/local/lib/libnet.dylib' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I think there's a problem with compile libnet from source for iOS. How do it correctly?
Get libnet 1.1.7
Open a terminal window and go to libnet folder, next we need to compile libnet for iOS7 emulator:
export CC=clang
export IPHONEOS_DEPLOYMENT_TARGET=7.0
export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH"
export CFLAGS="-arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.0.sdk -mios-simulator-version-min=7.0"
./configure
make
sudo make install
Begin by selecting the project in Xcode. Select Target and then select Build Settings. Scroll down in the Build Settings until you get to the Linking section. Under the Other Linker Flags option, add -lnet. Now scroll down until you reach the Search Paths section and add /usr/local/lib to Library Search Paths. Finally, add /usr/local/include to the header's search path.

Json in iOS5 showing error

"_OBJC_CLASS_$_SBJSON", referenced from:
Objc-class-ref in JparseViewController.o
Symbol(s) not found for architecture i386
Clang: error: linker command failed with exit code 1 (use -v to see invocation)
Ld /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator/Jparse.app/Jparse_armv7 armv7 i386
cd "/Users/mag1/Documents/Xcode Projects/Jparse"
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/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator -F/Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator -filelist /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Intermediates/Jparse.build/Debug-iphonesimulator/Jparse.build/Objects-armv7/i386/Jparse.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/mag1/Library/Developer/Xcode/DerivedData/Jparse-heknsvlbknssribatbwgkuefjoja/Build/Products/Debug-iphonesimulator/Jparse.app/Jparse_armv7
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SBJSON", referenced from:
objc-class-ref in JparseViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I got JSON framework files from downloaded example. The examples are working perfectly, but my project showing above errors.
Symbol(s) not found for architecture i386
The above error occurs in the following situation:
You were trying to run your application in the iPhone/iPad Simulator
The library was only built to run on the physical devices, and does not support being run in the Simulator.
To resolve this, you either need to add i386 to the Valid Architectures of the SBJSON library build target, or test your application using a physical device.
You didn't add the SBJSON.m file to your target. Check the properties panel for this file, and there should be a checkbox indicating which target it is assigned to. You may have simply forgotten to copy SBJSON.m into your project at all.
go to Projectapp -> Buildphases -> compileSources
here to add all .m files of JSON with + icon. problem will be resolved

Coreplot for implementing barchart

Am implementing barchart using coreplot...am getting the errors bellow which am unable to debug. Can anybody please help me out with the solution for this..Tried all ways but still couldn find the solution.
Ld /Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Products/Debug-iphonesimulator/DashBoard.app/DashBoard normal i386
cd /Users/MacMini/Desktop/DashBoard
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/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Products/Debug-iphonesimulator -L/Users/MacMini/Desktop/DashBoard -F/Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Products/Debug-iphonesimulator -F/Users/MacMini/Desktop/DashBoard -filelist /Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Intermediates/DashBoard.build/Debug-iphonesimulator/DashBoard.build/Objects-normal/i386/DashBoard.LinkFileList -mmacosx-version-min=10.6 -ObjC -all_load -Xlinker -objc_abi_version -Xlinker 2 -framework QuartzCore -lCorePlot-CocoaTouch -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/MacMini/Library/Developer/Xcode/DerivedData/DashBoard-cmeoxsnbrnrzrkcwmgmfxqlfuzvo/Build/Products/Debug-iphonesimulator/DashBoard.app/DashBoard
Undefined symbols for architecture i386:
"_CPTDecimalFromDouble", referenced from:
-[Barchart viewDidLoad] in Barchart.o
"_OBJC_CLASS_$_CPTGraphHostingView", referenced from:
objc-class-ref in Barchart.o
"_OBJC_CLASS_$_CPTXYGraph", referenced from:
objc-class-ref in Barchart.o
"_OBJC_CLASS_$_CPTPlotRange", referenced from:
objc-class-ref in Barchart.o
"_OBJC_CLASS_$_CPTBarPlot", referenced from:
objc-class-ref in Barchart.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This page (in the comments section) may help you with that: http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications
And this is a previous Stack Overflow question that looks like yours:
Using Core Plot iPhone - Linker error
Here are some fixes I found on the pages above:
In CorePlot-CocoaTouch project settings, change iOS Deployment Target to 3.2
change Build Active Architecture Only to No for all configurations
change C/C++ Compiler Version from GCC 4.2 to LLVM GCC 4.2
Reinstall Core-Plot after downloading its latest stable version

Resources