XCode - Programm erstellen

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • XCode - Programm erstellen

    Hallo,
    ich habe mir ein C/C++ Buch gekauft und will Programmieren lernen. Leider bin ich am ersten Beispiel schon gescheitert. Ich bekomme das Programm einfach nicht mit XCode compiliert und ausgeführt. Der Button "Build" ist deaktiviert. Wie kann man den mit XCode ein Programm compilieren und ausführen?

    Code:

    #include <Carbon/Carbon.h>
    #include <stdio.h>
    int main()
    {
    printf("Hello World\n");
    return 0;
    }

    Gruß Bernd
    [URL=http://www.bernd-lutz.de]bernd-lutz.de[/URL]
  • RE: XCode - Programm erstellen

    Lege ein neues Projekt an vom Typ "Foundation Tool" (findest du unter "Command Line Utility"). Dort gibst du deinen Code ein (das #include <Carbon/Carbon.h> kannst du getrost weglassen). Dann kannst du über den "build"-Button kompilieren.
    There are 10 kinds of people in the world - those who understand binary
    and those who don't.
  • RE: XCode - Programm erstellen

    Original von Squart
    ...Typ "Foundation Tool" (findest du unter "Command Line Utility"). ...
    Ups, kleiner Fehler. Dies geht zwar auch, aber besser ist doch "Standard Tool" zu nehmen.

    Gruß
    Squart
    There are 10 kinds of people in the world - those who understand binary
    and those who don't.