Symbol (e) nicht in XCode, Cocoa-Anwendung gefunden

Obwohl ich einige Entwicklungen in Java und ein wenig in C (++) durchgeführt habe, bin ich völlig neu in Objective C und XCode von Apple.

Somit bin ich total ratlos über folgende Fehlermeldung:

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

Es ist aus einer Standard-Cocoa-Anwendung, wobei main.m so aussieht:

import <Cocoa/Cocoa.h>
import <IOKit/ps/IOPowerSources.h>

int main(int argc, char *argv[])
{
    CFTypeRef powerInfo;
    IOPSCopyPowerSourcesList(powerInfo);
    NSLog(@"Foo");
    //return NSApplicationMain(argc,  (const char **) argv);
}

(Denken Sie daran - nur meine Füße nass hier ... Lernen durch vermasseln, vor allem :))

Ich vermute, dass die IOKit-Bibliothek nicht richtig verlinkt ist (wenn ich die arkanen Gedanken von g ++ richtig interpretiere ...), aber ich habe keine Ahnung, wie ich sie tatsächlich verlinken soll?

Für jede Hilfe dankbar - auch für Links zu nützlichen Tutorials zum Erstellen eigener Objective C-Apps.

Prost!

Antworten auf die Frage(3)

Ihre Antwort auf die Frage