I am trying to link HessianKit with a simple Xcode iOS test project.
I tried different build configurations.
I added the -ObjC switch to both the linker command line for the library project and for my main project.
This is the command line from the main project:
Ld /Users/wuttke/Library/Developer/Xcode/DerivedData/MatthiasSimpleTest-gfekzjmarzscwwgbynkuztivwkpw/Build/Products/Debug-iphonesimulator/MatthiasSimpleTest.app/MatthiasSimpleTest normal i386
cd /Users/wuttke/Documents/MatthiasSimpleTest
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/wuttke/Library/Developer/Xcode/DerivedData/MatthiasSimpleTest-gfekzjmarzscwwgbynkuztivwkpw/Build/Products/Debug-iphonesimulator -L/Users/wuttke/Documents/MatthiasSimpleTest/MatthiasSimpleTest -L/Users/wuttke/Documents/MatthiasSimpleTest -F/Users/wuttke/Library/Developer/Xcode/DerivedData/MatthiasSimpleTest-gfekzjmarzscwwgbynkuztivwkpw/Build/Products/Debug-iphonesimulator -F/Users/wuttke/Documents/MatthiasSimpleTest -filelist /Users/wuttke/Library/Developer/Xcode/DerivedData/MatthiasSimpleTest-gfekzjmarzscwwgbynkuztivwkpw/Build/Intermediates/MatthiasSimpleTest.build/Debug-iphonesimulator/MatthiasSimpleTest.build/Objects-normal/i386/MatthiasSimpleTest.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 -framework HessianKit -o /Users/wuttke/Library/Developer/Xcode/DerivedData/MatthiasSimpleTest-gfekzjmarzscwwgbynkuztivwkpw/Build/Products/Debug-iphonesimulator/MatthiasSimpleTest.app/MatthiasSimpleTest
This the error message from the linker:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CWHessianConnection", referenced from:
objc-class-ref in MainWindowController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I attached a screenshot showing the project (it contains the HessianKit.framework, we build for i386/MacOS, iOS 5.0).
This is some output showing the contents of the library to be linked:
Tobiass-MacBook-Pro:HessianKit.framework wuttke$ pwd
/Users/wuttke/Documents/MatthiasSimpleTest/HessianKit.framework
Tobiass-MacBook-Pro:HessianKit.framework wuttke$ ls
Headers HessianKit Resources Versions
Tobiass-MacBook-Pro:HessianKit.framework wuttke$ nm -arch i386 HessianKit | grep CWHessianConnection
000010a0 t +[CWHessianConnection proxyWithURL:protocol:]
00001020 t -[CWHessianConnection initWithHessianVersion:]
000011a0 t -[CWHessianConnection proxyWithURL:protocol:]
00001260 t -[CWHessianConnection setVersion:]
00001240 t -[CWHessianConnection version]
0000d000 S .objc_class_name_CWHessianConnection
I found the suggestion to try to include the HessianKit files directly with the project. This gives compile errors because of the ARC.
Have you got any suggestions I could try? Thanks a lot in advance.
Matthias
I am very new to Xcode and was able to solve this issue. I was trying to use HessianKit in a project I'm developing.
The solution to the problem is described in this post: https://stackoverflow.com/a/7866167/1366367
Apparently the iPhone simulator requires libraries to built for the i386 architecture not armv7.
This worked for me:
Open Project HessianKit (downloaded from sourceforge)
Set Base SDK on HessianKit target to iphonesimulator
Clear Base SDK for StaticHessianKit target (should default to iphonesimulator)
Run Build
Find libStaticHessianKit.a in ~/Library/Developer/Xcode/DerivedData/*/Build/Products/Debug-iphonesimulator folder
Drag libStaticHessianKit.a into your project. This should automatically set up library search paths.
Drag HessianKit framework folder to your project as well.
Make sure you import this where you are using HessianKit:
#import <HessianKit/HessianKit.h>
Good luck.
Related
I just opened my project which was made in xcode 3.1.5 version in xcode 4.2 and am getting the following error's can anyone please help me in this regard.
1)
Ld /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer normal i386
cd /Users/hasmukh.mandavia/Desktop/DevelopmentArea/ARecipe
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/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator -L/Users/hasmukh.mandavia/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/lib -L/Users/hasmukh.mandavia/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/lib/gstreamer-0.10 -L/Users/hasmukh.mandavia/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/lib/pkgconfig -F/Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator -filelist /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Intermediates/ARecipeViewer.build/Debug-iphonesimulator/ARecipeViewer.build/Objects-normal/i386/ARecipeViewer.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -lpocketsphinx -lsphinxbase -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=30100 -framework Foundation -framework UIKit -lsqlite3.0 -framework AudioToolbox -framework CFNetwork -liconv -lcv -lcxcore -framework CoreGraphics -framework QuartzCore -framework OpenGLES -o /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer
ld: library not found for -lcv
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1
2)
GenerateDSYMFile /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app.dSYM /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer
cd /Users/hasmukh.mandavia/Desktop/DevelopmentArea/ARecipe
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/usr/bin/dsymutil /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer -o /Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app.dSYM
error: unable to open executable '/Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer'
1.) As the first error says
ld: library not found for -lcv
It means your project needs a static library for 'cv' and
either its is not there in your project or placed at some different location(if you are using it)
or
you are putting additional compiler flag in build settings(if you are not using the library in your code). following compiler flags in build settings.
-liconv -lcv -lcxcore
put cv library at right location.(so that it can be included in project).
2.) Second error may be because .app file is yet not created in derived data directory.
Go at path shown in error, i.e.. and verify whether .app file exist or not.
error: unable to open executable '/Users/hasmukh.mandavia/Library/Developer/Xcode/DerivedData/ARecipeViewer-cdsqawgcznmakicuonkiinivjeed/Build/Products/Debug-iphonesimulator/ARecipeViewer.app/ARecipeViewer'
I'm trying to use Objective-Zip on an IOS5 iPhone application and I get the following linkage error when I build my project:
----------- ***********---------------
Ld /Users/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Products/Debug-iphonesimulator/Zarvaragh.app/Zarvaragh normal i386
cd /Users/amirpeivandi/Documents/iPhoenApps/Zarvaragh
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/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Products/Debug-iphonesimulator -F/Users/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Products/Debug-iphonesimulator -filelist /Users/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Intermediates/Zarvaragh.build/Debug-iphonesimulator/Zarvaragh.build/Objects-normal/i386/Zarvaragh.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=40300 -lz -framework CoreGraphics -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework UIKit -framework Foundation -o /Users/amirpeivandi/Library/Developer/Xcode/DerivedData/Zarvaragh-czcfescrnmgrljfojncagweywohi/Build/Products/Debug-iphonesimulator/Zarvaragh.app/Zarvaragh
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ZipFile", referenced from:
objc-class-ref in MainPageController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
----------- ***********---------------
I have no problem running the Objective-Zip application that comes with the code and I have checked my code, my project settings and all I could think of and the two projects (mine and default Objective-Zip iPhone project) have the same identical settings!
Any pointer would be greatly appreciated. I've been stuck for last couple of days on this silly thing. I've seen a few posts pointing to architecture supports and ARC setting but again I have two projects the way I see them identical one mine that is not compiling and one the one from Objective-Zip project that compiles and runs just fine!
Thx
Amir
Are you sure you have linked the Objective-Zip library in your project ? Because from the error it seems like it's not linked.
How can I compile an iPhone project against Base SDK "iOS 3.1.3" without getting error messages saying "Undefined symbols for architecture i386"?
When using Base SDK "iOS 5.0" everything works fine, but I need to make sure the application works under iOS 3.1.3.
I use XCode 4.2. My frameworks all point to
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.1.3.sdk/...
BUILD LOG:
Ld "***" normal i386
cd ***
setenv MACOSX_DEPLOYMENT_TARGET 10.5
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/iPhoneSimulator3.1.3.sdk
-L/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator
-F/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator
-filelist "/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Intermediates/***.build/Debug-iphonesimulator/***.build/Objects-normal/i386/***.LinkFileList"
-mmacosx-version-min=10.5
-Xlinker -objc_abi_version
-Xlinker 2 -Xlinker -no_implicit_dylibs
-D__IPHONE_OS_VERSION_MIN_REQUIRED=30000 -lsqlite3
-framework Foundation -framework UIKit -framework CoreGraphics
-o "/Users/***/Library/Developer/Xcode/DerivedData/***/Build/Products/Debug-iphonesimulator/***.app/***"
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_NSAutoreleasePool", referenced from:
"_OBJC_CLASS_$_NSDictionary", referenced from:
"_OBJC_CLASS_$_NSDecimalNumber", referenced from:
"_OBJC_CLASS_$_NSMutableCharacterSet", referenced from:
(and 50 more)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
You should always compile against the latest SDK. If you need to support older devices, you need to change the "Deployment Target" build setting, and test on a real device (since Apple no longer supplies the 3.x simulators).
It seems your problem is more to do with device/simulator (i386 refers to the intel chips in your mac) rather than iOS 3.1.3 vs iOS 5.0.
Try to change MACOSX_DEPLOYMENT_TARGET in build settings to 10.6 or Compiler Default
Remove and read your frameworks.
i'm using last version of VocalKit for iPhone https://github.com/KingOfBrian/VocalKit
I followed all instructions to add in new project as specified on github,
but on compile time i getting these errors:
Ld build/Debug-iphonesimulator/Voice.app/Voice normal i386
cd /Users/asd/Desktop/Voice
setenv MACOSX_DEPLOYMENT_TARGET 10.6
setenv PATH "/Developer-old/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer-old/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer-old/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -arch i386 -isysroot /Developer-old/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -L/Users/asd/Desktop/Voice/build/Debug-iphonesimulator -F/Users/asd/Desktop/Voice/build/Debug-iphonesimulator -filelist /Users/asd/Desktop/Voice/build/Voice.build/Debug-iphonesimulator/Voice.build/Objects-normal/i386/Voice.LinkFileList -mmacosx-version-min=10.6 -all_load -ObjC -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics "/Users/asd/Downloads/KingOfBrian-VocalKit-a25e5f3 2/build/Debug-iphonesimulator/libVocalKit.a" -framework AudioToolbox -liconv -o /Users/asd/Desktop/Voice/build/Debug-iphonesimulator/Voice.app/Voice
Undefined symbols:
"_ssymm_", referenced from:
_matrixmultiply in libVocalKit.a(matrix.o)
"_spotrf_", referenced from:
_determinant in libVocalKit.a(matrix.o)
"_sposv_", referenced from:
_invert in libVocalKit.a(matrix.o)
_solve in libVocalKit.a(matrix.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status
what can i do?
What's the cause of these problems?
I tried to import in xcode3 and xcode4, but it's the same.
My sdk version is 4.3.
thanks.
from the readme file on the github page...
I no longer advise using VocalKit, as a much better project, Open Ears has come out. http://www.politepix.com/openears/
Maybe check out openears?
Thanks all,
but I solved using google chrome speech.
Speech recognition framework for iOS that supports Spanish
Using chromium src: src.chromium.org/viewvc/chrome/trunk/src/content/browser/speech/
I was doing the Apple Core Data Tutorial, and on the first occasion I was suggested to build the project, I got this error:
Ld /Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator/Locations.app/Locations normal i386
cd "/Users/user/Documents/xcode projects/Locations"
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/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator -F/Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator -filelist /Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Intermediates/Locations.build/Debug-iphonesimulator/Locations.build/Objects-normal/i386/Locations.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -o /Users/user/Library/Developer/Xcode/DerivedData/Locations-fajvunxiruohofbhzimrgekrpnqh/Build/Products/Debug-iphonesimulator/Locations.app/Locations
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_CLLocationManager", referenced from:
objc-class-ref in RootViewController.o
"_kCLLocationAccuracyNearestTenMeters", referenced from:
-[RootViewController locationManager] in RootViewController.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
I use XCode 4.0.2, Mac OS X 10.6.8. What can be the cause of this? I followed the tutorial step-by-step and have absolutely no idea what could go wrong.
You need to import the CoreLocation framework. This can be done by going to the Project - Build Phases - Link Binary with Libraries
Looks like you need to add the CoreLocation framework to the linked frameworks of the project.
In the project settings, select the application target and under "Build Phases" add it to the "Link Binary With Libraries" step.
When you started the project did you select "Use Core Data For Storage"? I think it adds a framework you need.
click on your project in the navigation pane (apple + 1)
targets -> your project-> build phases -> link binaries with libraries -> +
then select CoreData.framework and add.
Sometimes the .m file is dropped out of the 'Compiled sources' list in XCode. You need to add the .m file manually:
Build phases > Compiled sources > (check for if your .m file is indeed missing) > Add .m file > Build