Three20 issue: _OBJC_METACLASS_$_TTURLRequestModel undefined? - iphone

Being new to iPhone development I was wanting to take it to the next level and use the Three20 library for a photo gallery I am building.
http://www.raywenderlich.com/1430/how-to-use-the-three20-photo-viewer
Everything seemed to go smoothly up to the point I tried testing the app and I got this error.
"_OBJC_METACLASS_$_TTURLRequestModel", referenced from:
Ld build/Debug-iphonesimulator/PhotoGallery.app/PhotoGallery normal i386
cd /Users/company/Documents/PhotoGallery
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.1.sdk -L/Users/company/Documents/PhotoGallery/build/Debug-iphonesimulator -F/Users/company/Documents/PhotoGallery/build/Debug-iphonesimulator -filelist /Users/company/Documents/PhotoGallery/build/PhotoGallery.build/Debug-iphonesimulator/PhotoGallery.build/Objects-normal/i386/PhotoGallery.LinkFileList -mmacosx-version-min=10.6 -ObjC -all_load -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework CFNetwork -framework SystemConfiguration -framework MobileCoreServices -lz.1.2.3 -framework CoreLocation -framework QuartzCore /Users/company/Documents/opensource/three20/Build/Products/Debug-iphonesimulator/libThree20.a -framework CoreData -o /Users/company/Documents/PhotoGallery/build/Debug-iphonesimulator/PhotoGallery.app/PhotoGallery
Undefined symbols:
"_OBJC_METACLASS_$_TTURLRequestModel", referenced from:
_OBJC_METACLASS_$_PhotoSet in PhotoSet.o
"_OBJC_CLASS_$_TTURLRequestModel", referenced from:
_OBJC_CLASS_$_PhotoSet in PhotoSet.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
Anyone

While I included the Three20 static library I didn't include the other dependencies in the same library such as Three20UINavigator.xcodeproj etc.
Sudo was pretty close. While I did include the proper libraries it was simply that they were not activated; I don't know the proper term :P
Basically, we should keep in mind that just because I dragged the Three20.xcodeproj into my project doesn't suffice when other extensions are needed as well. Simply drag all of the xcodeproj files necessary in (wherever you are keeping three20)/three20/src/(name of particular extension)/(name of particular file).xcodeproj into your projects "group and files" Then click on each extension and select the (name of particular file).a and check the checkbox on the far right of the file preview section. This is what I didn't do for all the extensions that seemed to resolve the problem even though I had previously included them all.

Related

IOS: Library not found for -lz.1.2.3

I don't understand my error:
Ld
Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/Test.app/Test
normal i386
cd /Users/lol/Desktop/Test
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/iPhoneSimulator5.0.sdk
-L/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator
-L/Users/lol/Desktop/Test -F/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator
-filelist /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Intermediates/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/i386/Test.LinkFileList
-mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -ObjC -D__IPHONE_OS_VERSION_MIN_REQUIRED=40000 -lextThree20JSON+SBJSON /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UICommon.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UINavigator.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Core.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20UI.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Network.a
/Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/libThree20Style.a
-framework SystemConfiguration -framework MobileCoreServices -framework CFNetwork -framework AddressBook -framework AddressBookUI -framework QuartzCore -framework UIKit -framework Foundation -framework MessageUI -framework CoreGraphics -lz.1.2.3 -lxml2.2.7.3 -o /Users/lol/Library/Developer/Xcode/DerivedData/Test-aywxyvnakaqhmwfbwellynwqmoik/Build/Products/Debug-iphonesimulator/Test.app/Test
ld: library not found for -lz.1.2.3
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1
Can you help me to understand this?
Thanks a lot ;)
The option -lz.1.2.3 means that the compiler is attempting to link the file libz.1.2.3.a, libz.1.2.3.so, or libz.1.2.3.dylib. It cannot find any of these variations and is failing because of that.
You can attempt to find the location of this file and include it in your library include path.
My question is why are you linking a specific version of z lib? Usually, it's good enough to just have -lz or -llibz.dylib. Do you have a reason for picking a specific version? What happens when you link using the un-versioned name.
Just use -lz, there's no need to use the versioned link to it. So remove libz-1.2.3.tbd from frameworks and add libz.tbd.
In the project navigator, select your project.
Select your target.
Select the "Build Phases" tab.
Open "Link Binaries With Libraries" expander.
Remove libz-1.2.3.tbd
Click the + button.
Add libz.tbd

Objective-Zip iPhone IOS 5 issue

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.

Error after creation of core data files

I have started adding core data to my application. I created the entity with name Assets and defined its four attributes and then created Asset.h and Asset.m file for NSManagedObject. Now I am getting the following error while before that my application was working fine
Ld /Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Products/Debug-iphonesimulator/LoginTest.app/LoginTest normal i386
cd /Users/Omer/Desktop/Docs/LoginTest
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/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Products/Debug-iphonesimulator -L/Users/Omer/Desktop/Docs/LoginTest/ZBarSDK -F/Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Products/Debug-iphonesimulator -filelist /Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Intermediates/LoginTest.build/Debug-iphonesimulator/LoginTest.build/Objects-normal/i386/LoginTest.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -liconv -framework QuartzCore -framework CoreVideo -framework CoreMedia -framework AVFoundation -framework MapKit -framework CoreLocation -lz -framework CoreGraphics -framework MobileCoreServices -framework SystemConfiguration -framework CFNetwork -framework Foundation -framework UIKit -lzbar -o /Users/Omer/Library/Developer/Xcode/DerivedData/LoginTest-enoqygjnncuapjescysdafbighag/Build/Products/Debug-iphonesimulator/LoginTest.app/LoginTest
Undefined symbols for architecture i386:
"_OBJC_METACLASS_$_NSManagedObject", referenced from:
_OBJC_METACLASS_$_Asset in Asset.o
"_OBJC_CLASS_$_NSManagedObject", referenced from:
_OBJC_CLASS_$_Asset in Asset.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Please include coreData framework ...
I wouldn't create these classes myself. I"d recommend you to delete them and use mogenerator to do it for you. It will create 4 classes for each entity. In your example it would be:
_Assets.h
_Assets.m
Assets.h
Assets.m
don't touch the _Assets.h and _Assets.m files, do all what you need in Assets.h and Assets.m.
Hope it helps
Add Core Data
You need to add core data framework as suggested by Ali3n.
How To Add A Framework
If you don't know how to add a framework to your project do the following:
In the project navigator, select your project
Select your target
Select the 'Build Phases' tab
Open 'Link Binaries With Libraries' expander
Click the '+' button
Select your framework
(optional) Drag and drop the added framework to the 'Frameworks' group
Link to the original post: How to "add existing frameworks" in Xcode 4?
I got the linker error because I only imported the "human" files into my project and not the "machine" files.

"library not found for -lcocos2d libraries" after associating new cocos2d framework

Im getting the below build errors after reassociating all of the 'cocos2d sources' files into my project to update it from 0.99.0 to 0.99.3. Any clues what might be causing this or do I have to create a new project with the appropriate template and associate the proper files into the new project?
PS. I am not upgrading to the newest version as it requires Lion or an Apple developer license which I have not yet procured.
Building target “Puzzle” of project “Puzzle” with configuration “Debug”
Checking Dependencies
Ld "/Users/Sup3rpanda/Dev/My Projects/Builds/Debug-iphonesimulator/Puzzle.app/Puzzle" normal i386
cd "/Users/Sup3rpanda/Dev/My Projects/Puzzle"
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/gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.3.sdk "-L/Users/Sup3rpanda/Dev/My Projects/Builds/Debug-iphonesimulator" "-F/Users/Sup3rpanda/Dev/My Projects/Builds/Debug-iphonesimulator" -filelist "/Users/Sup3rpanda/Dev/My Projects/Builds/Puzzle.build/Debug-iphonesimulator/Puzzle.build/Objects-normal/i386/Puzzle.LinkFileList" -mmacosx-version-min=10.5 -all_load -ObjC -framework CoreGraphics -framework Foundation -framework OpenGLES -framework QuartzCore -framework UIKit -framework AudioToolbox -framework OpenAL -lz -framework AVFoundation "-lcocos2d libraries" -o "/Users/Sup3rpanda/Dev/My Projects/Builds/Debug-iphonesimulator/Puzzle.app/Puzzle"
ld: library not found for -lcocos2d libraries
collect2: ld returned 1 exit status
Weird, there was a 'libcocos2d.a' being built as a target. Removing that allowed me to successfully build again.
http://www.cocos2d-iphone.org/forum/topic/3384

Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1ld: library not found for -liLibs

I am getting Apple Mach-O Linker Id error, while compiling the iphone app. And getting below error
Ld
"/Users/adminbluepal/Library/Developer/Xcode/DerivedData/Tiger-czyksblsmfqdqybamuutemvjbdek/Build/Products/Debug-iphonesimulator/Tiger
Dev.app/Tiger Dev" normal i386
cd /Users/adminbluepal/Desktop/Dir-Tiger_latest
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/adminbluepal/Library/Developer/Xcode/DerivedData/Tiger-czyksblsmfqdqybamuutemvjbdek/Build/Products/Debug-iphonesimulator
-F/Users/adminbluepal/Library/Developer/Xcode/DerivedData/Tiger-czyksblsmfqdqybamuutemvjbdek/Build/Products/Debug-iphonesimulator
-filelist "/Users/adminbluepal/Library/Developer/Xcode/DerivedData/Tiger-czyksblsmfqdqybamuutemvjbdek/Build/Intermediates/Tiger.build/Debug-iphonesimulator/Tiger.build/Objects-normal/i386/Tiger
Dev.LinkFileList" -Xlinker
--no-demangle -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -liLibs -framework AVFoundation -framework AudioToolbox -framework CoreMedia
-framework Foundation -framework GameKit -framework OpenGLES -framework
QuartzCore -framework Security
-framework SystemConfiguration -framework UIKit -lz -o "/Users/adminbluepal/Library/Developer/Xcode/DerivedData/Tiger-czyksblsmfqdqybamuutemvjbdek/Build/Products/Debug-iphonesimulator/Tiger
Dev.app/Tiger Dev"
ld: library not found for -liLibs
collect2: ld returned 1 exit status
Command
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2
failed with exit code 1
Please help me out of this
Thank you,
Madan Mohan
Yesterday i had this problem.... cleared that error with the help of this answer. it may help you also...
You probably don't have the CoreGraphics.framework added to your frameworks list.
To make sure, click the "Frameworks" folder on Xcode. If the framework isn't listed on the table to the right, you'll need to add it by right-clicking the Frameworks folder, chooseing "Add Existing Framework..." and then choosing it from the list.
Source stack overflow previous question
Sounds like you're trying to use the iLibs library (Google says it's something for game development). XCode cannot properly link to it. Try adding their Framework to your project, or read the help docs of the library for help with its setup. Alternatively, see if you can remove the "-liLibs" linker flag in your build settings, if you aren't using the library.