PDA

View Full Version : Log4Cocoa




badmac78
Jul 16, 2010, 05:50 PM
I've been developing for about a year now with XCode and wanted something more descriptive when debugging. I found that someone had created a Log4j port for Cocoa (Log4Cocoa). Trying to get the framework to work, but I get the following error when compiling. Any ideas?


Using XCode 3.2.3

Build WordsThatFit of project WordsThatFit with configuration Debug

CompileC build/WordsThatFit.build/Debug-iphonesimulator/WordsThatFit.build/Objects-normal/i386/wordDictionaryHelper.o wordDictionaryHelper.m normal i386 objective-c com.apple.compilers.gcc.4_2
cd "/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit"
setenv LANG en_US.US-ASCII
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 -x objective-c -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-function -Wunused-variable -Wunused-value -D__IPHONE_OS_VERSION_MIN_REQUIRED=30200 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk -fvisibility=hidden -mmacosx-version-min=10.6 -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote "/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/WordsThatFit.build/Debug-iphonesimulator/WordsThatFit.build/WordsThatFit-generated-files.hmap" "-I/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/WordsThatFit.build/Debug-iphonesimulator/WordsThatFit.build/WordsThatFit-own-target-headers.hmap" "-I/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/WordsThatFit.build/Debug-iphonesimulator/WordsThatFit.build/WordsThatFit-all-target-headers.hmap" -iquote "/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/WordsThatFit.build/Debug-iphonesimulator/WordsThatFit.build/WordsThatFit-project-headers.hmap" "-F/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/Debug-iphonesimulator" -F/Developer/Library/Frameworks -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/Developer/Library/Frameworks "-I/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/Debug-iphonesimulator/include" "-I/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/WordsThatFit.build/Debug-iphonesimulator/WordsThatFit.build/DerivedSources/i386" "-I/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/WordsThatFit.build/Debug-iphonesimulator/WordsThatFit.build/DerivedSources" -include /var/folders/99/99EcC0bxHs8SzmIWoFNAYU+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/WordsThatFit_Prefix-dwjybaiqxddwxzccssqvqkasylsw/WordsThatFit_Prefix.pch -c "/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/wordDictionaryHelper.m" -o "/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/WordsThatFit.build/Debug-iphonesimulator/WordsThatFit.build/Objects-normal/i386/wordDictionaryHelper.o"

...

Ld build/Debug-iphonesimulator/WordsThatFit.app/WordsThatFit normal i386
cd "/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit"
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.0.sdk "-L/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/Debug-iphonesimulator" "-F/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/Debug-iphonesimulator" -F/Developer/Library/Frameworks -F/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.0.sdk/Developer/Library/Frameworks -filelist "/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/WordsThatFit.build/Debug-iphonesimulator/WordsThatFit.build/Objects-normal/i386/WordsThatFit.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -framework Foundation -framework UIKit -framework CoreGraphics -framework CoreData -framework iAd -framework Log4Cocoa -o "/Users/blah/Dropbox/Business/AppleSeed Technologies/Code/WordsThatFit/build/Debug-iphonesimulator/WordsThatFit.app/WordsThatFit"

ld: framework not found Log4Cocoa
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1



PhoneyDeveloper
Jul 16, 2010, 08:13 PM
There's no framework search path that includes the directory where your Log4Cocoa framework is found.

Did you add the Log4Cocoa.framework file to your project? That should be all that's needed to find it.

robbieduncan
Jul 17, 2010, 03:35 AM
If you are developing for the iPhone be aware you cannot use Frameworks in it. You can use statically linked libraries as they are linked into the executable at compile time. There is no dynamic/run-time linking on the device.

cybersorcerer
Jul 25, 2010, 12:53 PM
Hi i use log4cocoa in my projects and i like it a lot*
however i agree the documentation is not as good as it could be. Here is a link which should get you going. Its for using it with iphone development, but with one exception (categories) it should work for os x too.

http://cavoort.com/2010/01/04/log4cocoa-in-an-iphone-project/

Hope this helps

greetings

Ronny

badmac78
Aug 8, 2010, 08:00 PM
great, thanks!!