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.
Related
I'm trying to compile a React Native app on iOS.
Many times I encounter an error related to the linker, which essentially says that dylib reports there are undefined symbols, which are related to some pod modules linked to the project.
In my case I'm having trouble with react-native-svg
To install the package and compile:
$ npm install --save react-native-svg
$ npx pod-install # or cd ios && pod install && cd ..
$ npx react-native link react-native-svg
$ open ios/<project-name>.xcworkspace &
$ # then compile the react-native project in iOS
So:
Package is installed
Podfiles are installed
Package is linked
Sometimes this happens when compiling for simulator (x86_64) and sometimes it happens when compiling for my device (arm64). It appears randomly, but nothing I do solves the problem. Sometimes it works after a reboot, sometimes not. Sometimes it works after cleaning the build folder , sometimes not. Sometimes it works after restarting Xcode, sometimes not. Sometimes it works after re-running pod install and re-linking works, sometimes not. Nothing appears to work consistently.
Any insight would be appreciated.
The errors are as follows
Ld /Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/RNSVG/RNSVG.framework/RNSVG normal (in target 'RNSVG' from project 'Pods')
cd /Users/adonis/sandbox/my-projects/github/pktwallet-mobile/ios-tests/pktwallet/ios/Pods
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -target arm64-apple-ios9.0 -dynamiclib -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS15.2.sdk -L/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/RNSVG -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/RNSVG -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/DoubleConversion -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/FBReactNativeSpec -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/RCT-Folly -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/RCTTypeSafety -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-Core -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-RCTAnimation -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-RCTBlob -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-RCTImage -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-RCTLinking -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-RCTNetwork -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-RCTSettings -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-RCTText -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-RCTVibration -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-cxxreact -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-jsi -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-jsiexecutor -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-jsinspector -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/React-perflogger -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/ReactCommon -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/Yoga -F/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/glog -filelist /Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/RNSVG.build/Objects-normal/arm64/RNSVG.LinkFileList -install_name #rpath/RNSVG.framework/RNSVG -Xlinker -rpath -Xlinker #executable_path/Frameworks -Xlinker -rpath -Xlinker #loader_path/Frameworks -dead_strip -Xlinker -object_path_lto -Xlinker /Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/RNSVG.build/Objects-normal/arm64/RNSVG_lto.o -Xlinker -export_dynamic -Xlinker -no_deduplicate -fembed-bitcode-marker -fobjc-arc -fobjc-link-runtime -framework Foundation -compatibility_version 1 -current_version 1 -Xlinker -dependency_info -Xlinker /Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Intermediates.noindex/Pods.build/Debug-iphoneos/RNSVG.build/Objects-normal/arm64/RNSVG_dependency_info.dat -o /Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/RNSVG/RNSVG.framework/RNSVG
ld: warning: dylib (/Users/adonis/Library/Developer/Xcode/DerivedData/pktwallet-cuihgpnujfgpvbcdatertduvqenu/Build/Products/Debug-iphoneos/Yoga/yoga.framework/yoga) was built for newer iOS version (10.0) than being linked (9.0)
Undefined symbols for architecture arm64:
"__RCTNotImplementedException", referenced from:
-[RNSVGPainter init] in RNSVGPainter.o
"_OBJC_CLASS_$_RCTFont", referenced from:
objc-class-ref in RNSVGGlyphContext.o
"_OBJC_METACLASS_$_RCTViewManager", referenced from:
_OBJC_METACLASS_$_RNSVGDefsManager in RNSVGDefsManager.o
_OBJC_METACLASS_$_RNSVGNodeManager in RNSVGNodeManager.o
_OBJC_METACLASS_$_RNSVGSvgViewManager in RNSVGSvgViewManager.o
"_OBJC_CLASS_$_RCTViewManager", referenced from:
_OBJC_CLASS_$_RNSVGDefsManager in RNSVGDefsManager.o
_OBJC_CLASS_$_RNSVGNodeManager in RNSVGNodeManager.o
_OBJC_CLASS_$_RNSVGSvgViewManager in RNSVGSvgViewManager.o
"_RCTConvertEnumValue", referenced from:
+[RCTConvert(RNSVG) RNSVGCGFCRule:] in RCTConvert+RNSVG.o
+[RCTConvert(RNSVG) RNSVGVBMOS:] in RCTConvert+RNSVG.o
+[RCTConvert(RNSVG) RNSVGUnits:] in RCTConvert+RNSVG.o
"__RCTLogNativeInternal", referenced from:
+[RCTConvert(RNSVG) RNSVGBrush:] in RCTConvert+RNSVG.o
+[RCTConvert(RNSVG) RNSVGCGRect:offset:] in RCTConvert+RNSVG.o
+[RCTConvert(RNSVG) RNSVGCGColor:offset:] in RCTConvert+RNSVG.o
-[RNSVGNode svgView] in RNSVGNode.o
+[RNSVGNodeManager CATransform3DFromMatrix:] in RNSVGNodeManager.o
+[RNSVGNodeManager CATransform3D:] in RNSVGNodeManager.o
-[RNSVGPainter paintLinearGradient:bounds:] in RNSVGPainter.o
...
"_RCTExecuteOnUIManagerQueue", referenced from:
___58-[RNSVGSvgViewManager toDataURL:options:callback:attempt:]_block_invoke in RNSVGSvgViewManager.o
"_RCTRegisterModule", referenced from:
+[RNSVGCircleManager load] in RNSVGCircleManager.o
+[RNSVGClipPathManager load] in RNSVGClipPathManager.o
+[RNSVGDefsManager load] in RNSVGDefsManager.o
+[RNSVGEllipseManager load] in RNSVGEllipseManager.o
+[RNSVGForeignObjectManager load] in RNSVGForeignObjectManager.o
+[RNSVGGroupManager load] in RNSVGGroupManager.o
+[RNSVGImageManager load] in RNSVGImageManager.o
...
"_OBJC_CLASS_$_RCTConvert", referenced from:
__OBJC_$_CATEGORY_RCTConvert_$_RNSVG in RCTConvert+RNSVG.o
objc-class-ref in RNSVGForeignObjectManager.o
objc-class-ref in RNSVGImage.o
objc-class-ref in RNSVGImageManager.o
objc-class-ref in RNSVGMaskManager.o
objc-class-ref in RNSVGNodeManager.o
objc-class-ref in RNSVGPainter.o
...
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I was with the exact same error here after added use_frameworks! in my Podfile, I suggest you reinstall to the newest version of this package, only this resolved for me.
execute this commands if you are using RN >= 0.60:
$ yarn remove react-native-svg
$ react-native unlink react-native-svg
$ yarn add react-native-svg
$ cd ios && pod install
It seems like the solution was to go to my Pods and to upgrade the Deployment Target version.
I got this error when compiling my code:
Ld /Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Products/Debug-iphonesimulator/BusinessIdea.app/BusinessIdea normal i386
cd /Users/owner12/Desktop/BusinessIdea
setenv IPHONEOS_DEPLOYMENT_TARGET 6.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/iPhoneSimulator6.1.sdk -L/Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Products/Debug-iphonesimulator -L/Users/owner12/Desktop/BusinessIdea/BusinessIdea/Airship -F/Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Products/Debug-iphonesimulator -filelist /Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Intermediates/BusinessIdea.build/Debug-iphonesimulator/BusinessIdea.build/Objects-normal/i386/BusinessIdea.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=6.0 -framework UIKit -framework Foundation -framework CoreGraphics -lUAirship-1.4.0 -lUAirshipFull-1.4.0 -o /Users/owner12/Library/Developer/Xcode/DerivedData/BusinessIdea-degqppvjmvixescuvttxsvcksqtf/Build/Products/Debug-iphonesimulator/BusinessIdea.app/BusinessIdea
Undefined symbols for architecture i386:
"_AudioServicesCreateSystemSoundID", referenced from:
-[UAPushNotificationHandler playNotificationSound:] in UAPushNotificationHandler.o
-[UAPushSettingsSoundsViewController tableView:didSelectRowAtIndexPath:] in UAPushSettingsSoundsViewController.o
"_AudioServicesPlayAlertSound", referenced from:
-[UAPushNotificationHandler playNotificationSound:] in UAPushNotificationHandler.o
-[UAPushSettingsSoundsViewController tableView:didSelectRowAtIndexPath:] in UAPushSettingsSoundsViewController.o
"_AudioServicesPlaySystemSound", referenced from:
-[UAPushNotificationHandler playNotificationSound:] in UAPushNotificationHandler.o
"_CFHTTPAuthenticationCopyMethod", referenced from:
-[UA_ASIHTTPRequest attemptToApplyProxyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
-[UA_ASIHTTPRequest attemptToApplyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
"_CFHTTPAuthenticationCopyRealm", referenced from:
-[UA_ASIHTTPRequest attemptToApplyProxyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
-[UA_ASIHTTPRequest attemptToApplyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
"_CFHTTPAuthenticationCreateFromResponse", referenced from:
-[UA_ASIHTTPRequest attemptToApplyProxyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
-[UA_ASIHTTPRequest attemptToApplyCredentialsAndResume] in libUAirship-1.4.0.a(UA_ASIHTTPRequest.o)
They are very cryptic and googling the whole error does not bring up much. Would anyone know why this happens and how to resolve this?
Thanks!
You have to add the following frameworks to your project. AudioServices, CFNetwork, SystemConfiguration, MobileCoreServices, zlib, and libxml2. For libxml2 and zlib, you have to add 2 entries to Header Search Paths in your build settings. /usr/include/ and /usr/include/libxml2/.
To add them (they are already included in Xcode), do this
Click the plus button, and add all the frameworks I listed above. (Cocoa.framework is not required, that's just from my project). This is located in your projects summary if you scroll down.
I am trying to use address framework in my project. I have linked the frameworks AddressBookUI.framework and AddressBook.framework in my project. But still i am getting the below error while building the app.
Help me to figure out the issue please.
Ld "/Users/sathishkumar/Library/Developer/Xcode/DerivedData/Easy_Contacts-eafemguogncacmhgnbfsjtizjcbd/Build/Products/Debug-iphonesimulator/Easy Contacts.app/Easy Contacts" normal i386
cd "/Users/sathishkumar/projects/Easy Contacts"
setenv MACOSX_DEPLOYMENT_TARGET 10.6
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/iPhoneSimulator5.1.sdk -L/Users/sathishkumar/Library/Developer/Xcode/DerivedData/Easy_Contacts-eafemguogncacmhgnbfsjtizjcbd/Build/Products/Debug-iphonesimulator -F/Users/sathishkumar/Library/Developer/Xcode/DerivedData/Easy_Contacts-eafemguogncacmhgnbfsjtizjcbd/Build/Products/Debug-iphonesimulator -filelist "/Users/sathishkumar/Library/Developer/Xcode/DerivedData/Easy_Contacts-eafemguogncacmhgnbfsjtizjcbd/Build/Intermediates/Easy Contacts.build/Debug-iphonesimulator/Easy Contacts.build/Objects-normal/i386/Easy Contacts.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50100 -framework UIKit -framework Foundation -framework CoreGraphics -o "/Users/sathishkumar/Library/Developer/Xcode/DerivedData/Easy_Contacts-eafemguogncacmhgnbfsjtizjcbd/Build/Products/Debug-iphonesimulator/Easy Contacts.app/Easy Contacts"
Undefined symbols for architecture i386:
"_ABRecordCopyValue", referenced from:
-[ViewController displayPerson:] in ViewController.o
"_ABMultiValueGetCount", referenced from:
-[ViewController displayPerson:] in ViewController.o
"_ABMultiValueCopyValueAtIndex", referenced from:
-[ViewController displayPerson:] in ViewController.o
"_OBJC_CLASS_$_ABPeoplePickerNavigationController", referenced from:
objc-class-ref in ViewController.o
"_kABPersonFirstNameProperty", referenced from:
-[ViewController displayPerson:] in ViewController.o
"_kABPersonPhoneProperty", referenced from:
-[ViewController displayPerson:] 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)
Add <AddressBook/AddressBook.h> to the file, AddressBookUI is just that address book UI.
Did you import those frameworks into your .h files?
"_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
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