Although I did some Java development and a bit of C (++), I am completely new to Apple Objective-C and Xcode.
Thus, I am completely puzzled by the following error message:
Building target "BatteryApp" of project "BatteryApp" with configuration "Debug" β (1 error) cd /Users/soren/Documents/BatteryApp setenv MACOSX_DEPLOYMENT_TARGET 10.5 /Developer/usr/bin/gcc-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/Users/soren/Documents/BatteryApp/build/Debug -F/Users/soren/Documents/BatteryApp/build/Debug -filelist /Users/soren/Documents/BatteryApp/build/BatteryApp.build/Debug/BatteryApp.build/Objects-normal/i386/BatteryApp.LinkFileList -mmacosx-version-min=10.5 -framework Cocoa -o /Users/soren/Documents/BatteryApp/build/Debug/BatteryApp.app/Contents/MacOS/BatteryApp Undefined symbols: "_IOPSCopyPowerSourcesList", referenced from: _main in main.o ld: symbol(s) not found collect2: ld returned 1 exit status "_IOPSCopyPowerSourcesList", referenced from: _main in main.o ld: symbol(s) not found collect2: ld returned 1 exit status
This is from the Cocoa default application, with main.m looking like this:
import <Cocoa/Cocoa.h> import <IOKit/ps/IOPowerSources.h> int main(int argc, char *argv[]) { CFTypeRef powerInfo; IOPSCopyPowerSourcesList(powerInfo); NSLog(@"Foo");
(Remember - just wet my legs here ... Learning to spin, mostly :))
I assume that the IOKit library is not linked correctly (if I correctly interpret the secret thoughts of g ++ ...), but I have no idea how to actually link it?
Any help is appreciated - also any links to good tutorials on building your own Objective-C applications.
Hooray!
SΓΈren andersen
source share