• Apfeltalk ändert einen Teil seiner Allgemeinen Geschäftsbedingungen (AGB), das Löschen von Useraccounts betreffend.
    Näheres könnt Ihr hier nachlesen: AGB-Änderung
  • Was gibt es Schöneres als den Mai draußen in der Natur mit allen Sinnen zu genießen? Lasst uns teilhaben an Euren Erlebnissen und macht mit beim Thema des Monats Da blüht uns was! ---> Klick

xcode will nicht kompilieren

deräppel

Boskoop
Registriert
11.12.08
Beiträge
41
Code:
[COLOR=#000000][COLOR=#ff8000]//Rechner2.cpp 

#include <iostream> 
#include <math.h>                    //der header wird fur bestimmte mathematische operationen gebraucht 


[/COLOR][COLOR=#0000bb]using namespace std[/COLOR][COLOR=#007700]; 

[/COLOR][COLOR=#0000bb]int menu[/COLOR][COLOR=#007700]() {                     [/COLOR][COLOR=#ff8000]//Der ubersichtlichkeit halber machen wir ein modul 

[/COLOR][COLOR=#0000bb]int i[/COLOR][COLOR=#007700]; 

[/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t<---------Taschenrechner----------->"    [/COLOR][COLOR=#ff8000]//das /n heist neue zeile /t einen tab sprung vorgehen in der zeile 
     [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t(1) Addieren"                [/COLOR][COLOR=#ff8000]//jetz haben wir auch ein etwas ubersichtlicheres menu 
     [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t(2) Subtrahieren" 
     [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t(3) Multiplizieren" 
     [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t(4) Diviedieren" 
     [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t(5) Potenz" 
     [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t(6) Wurzel" 
     [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t<----------------------------------->"[/COLOR][COLOR=#007700]; 
[/COLOR][COLOR=#0000bb]cin [/COLOR][COLOR=#007700]>> [/COLOR][COLOR=#0000bb]i[/COLOR][COLOR=#007700];                        [/COLOR][COLOR=#ff8000]//eingabe der auswahl ist ist ja oben deklariert worden 
[/COLOR][COLOR=#007700]return [/COLOR][COLOR=#0000bb]i[/COLOR][COLOR=#007700];                        [/COLOR][COLOR=#ff8000]//wichtig damit wir i in userer haupfunktion benutzen können 
[/COLOR][COLOR=#007700]} 

[/COLOR][COLOR=#0000bb]int main[/COLOR][COLOR=#007700]() {                        [/COLOR][COLOR=#ff8000]//hauptmenu sozusagen 

[/COLOR][COLOR=#0000bb]bool quit[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]false[/COLOR][COLOR=#007700];                    [/COLOR][COLOR=#ff8000]//eine ja/nein variable 
[/COLOR][COLOR=#0000bb]int schluss[/COLOR][COLOR=#007700];                        [/COLOR][COLOR=#ff8000]//zum beenden das kennen wir ja schon 
[/COLOR][COLOR=#0000bb]long double a[/COLOR][COLOR=#007700], [/COLOR][COLOR=#0000bb]b[/COLOR][COLOR=#007700]; 
[/COLOR][COLOR=#0000bb]int aus[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]menu[/COLOR][COLOR=#007700]();                        [/COLOR][COLOR=#ff8000]//damit wir wissen was ausgewäehlt wurde 
[/COLOR][COLOR=#007700]do {                            [/COLOR][COLOR=#ff8000]//do schleife damit bestimmte dinge wiederhollt werden 
[/COLOR][COLOR=#007700]switch ([/COLOR][COLOR=#0000bb]aus[/COLOR][COLOR=#007700]) {                        [/COLOR][COLOR=#ff8000]//bedingungs schleife 
    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]:                     
    case [/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700]: 
    case [/COLOR][COLOR=#0000bb]3[/COLOR][COLOR=#007700]:                        [/COLOR][COLOR=#ff8000]//wir sparen uns schreibarbeit^^ 
    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]4[/COLOR][COLOR=#007700]: 

        [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\n\tBitte erste Zahl eingeben"[/COLOR][COLOR=#007700]; 
        [/COLOR][COLOR=#0000bb]cin [/COLOR][COLOR=#007700]>> [/COLOR][COLOR=#0000bb]a[/COLOR][COLOR=#007700]; 
        [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\n\tBitte zweite Zahl eingeben"[/COLOR][COLOR=#007700]; 
        [/COLOR][COLOR=#0000bb]cin [/COLOR][COLOR=#007700]>> [/COLOR][COLOR=#0000bb]b[/COLOR][COLOR=#007700]; 
        switch([/COLOR][COLOR=#0000bb]aus[/COLOR][COLOR=#007700]) {                            [/COLOR][COLOR=#ff8000]//nochmal das selbe nur jetz einzeln 

            [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]1[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t" [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]" + " [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]b [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]" = " [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]+ [/COLOR][COLOR=#0000bb]b [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]endl[/COLOR][COLOR=#007700]; break;    [/COLOR][COLOR=#ff8000]//plus 
                  [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]2[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t" [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]" - " [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]b [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]" = " [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]- [/COLOR][COLOR=#0000bb]b [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]endl[/COLOR][COLOR=#007700]; break;    [/COLOR][COLOR=#ff8000]//minus 
                  [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]3[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t" [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]" * " [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]b [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]" = " [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]* [/COLOR][COLOR=#0000bb]b [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]endl[/COLOR][COLOR=#007700]; break;    [/COLOR][COLOR=#ff8000]//mal 
                  [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]4[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t" [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]" / " [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]b [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]" = " [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]/ [/COLOR][COLOR=#0000bb]b [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]endl[/COLOR][COLOR=#007700]; break;    [/COLOR][COLOR=#ff8000]//geteilt 
        [/COLOR][COLOR=#007700]} 
    [/COLOR][COLOR=#0000bb]quit[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]true[/COLOR][COLOR=#007700];                                [/COLOR][COLOR=#ff8000]//beenden auf wahr setzen 
    [/COLOR][COLOR=#007700]break;                        [/COLOR][COLOR=#ff8000]//das break nicht vergessen sonst gehts ins unendliche^^ 
    [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]5[/COLOR][COLOR=#007700]: 
    case [/COLOR][COLOR=#0000bb]6[/COLOR][COLOR=#007700]: 
        [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\n\tBitte Zahl eingeben"[/COLOR][COLOR=#007700]; 
        [/COLOR][COLOR=#0000bb]cin [/COLOR][COLOR=#007700]>> [/COLOR][COLOR=#0000bb]a[/COLOR][COLOR=#007700]; 
        switch ([/COLOR][COLOR=#0000bb]aus[/COLOR][COLOR=#007700]) {                        [/COLOR][COLOR=#ff8000]//nochmal das kennen wir ja schon^^ 
             
             
            [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]5[/COLOR][COLOR=#007700]: [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\t" [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]" zum quadrat ist =" [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a[/COLOR][COLOR=#007700]*[/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]endl[/COLOR][COLOR=#007700]; break;    [/COLOR][COLOR=#ff8000]//hochrechnen 
            [/COLOR][COLOR=#007700]case [/COLOR][COLOR=#0000bb]6[/COLOR][COLOR=#007700]:    [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\tDie Wurzel von " [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]a [/COLOR][COLOR=#007700]<<  [/COLOR][COLOR=#dd0000]"=" [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#0000bb]sqrt[/COLOR][COLOR=#007700]([/COLOR][COLOR=#0000bb]a[/COLOR][COLOR=#007700]) << [/COLOR][COLOR=#0000bb]endl[/COLOR][COLOR=#007700]; break; 

[/COLOR][COLOR=#ff8000]//dafur brauchen wir math.h denn sonst konnte man keine wurzel ziehen 

        [/COLOR][COLOR=#007700]}                    [/COLOR][COLOR=#ff8000]//bedingung schliesen 
    [/COLOR][COLOR=#0000bb]quit[/COLOR][COLOR=#007700]=[/COLOR][COLOR=#0000bb]true[/COLOR][COLOR=#007700];                    [/COLOR][COLOR=#ff8000]//nochmal beenden auf wahr 
    [/COLOR][COLOR=#007700]break;                        [/COLOR][COLOR=#ff8000]//Break nicht vergessen 

    [/COLOR][COLOR=#007700]default: 
        [/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\tFalsche eingabe"[/COLOR][COLOR=#007700];            [/COLOR][COLOR=#ff8000]//Bei falscher eingabe 
    [/COLOR][COLOR=#007700]break; 
                         
}                            [/COLOR][COLOR=#ff8000]//Klamer von hauptbedingung schliesen 


[/COLOR][COLOR=#007700]}while (![/COLOR][COLOR=#0000bb]quit[/COLOR][COLOR=#007700]);                        [/COLOR][COLOR=#ff8000]//do schleife schliesen mit bedingung das quit nicht wahr sein darf                     

[/COLOR][COLOR=#0000bb]cout [/COLOR][COLOR=#007700]<< [/COLOR][COLOR=#dd0000]"\n\tBeliebige Taste und dann enter druecken zum beenden"[/COLOR][COLOR=#007700]; 
[/COLOR][COLOR=#0000bb]cin [/COLOR][COLOR=#007700]>> [/COLOR][COLOR=#0000bb]schluss[/COLOR][COLOR=#007700]; 

return [/COLOR][COLOR=#0000bb]0[/COLOR][COLOR=#007700]; 

}                            [/COLOR][COLOR=#ff8000]//Hauptklammer schliesen und fertig^^  [/COLOR][/COLOR]
diesen quellcode (von hier) hab ich bei xcode eingefügt, als ich ihn kompilieren wollte konnte ich nicht auf "build" klicken, die schaltfläche war grau, also man konnte nicht draufklicken.

so sah das ganze aus:
Bild_1.png


wieso will es nicht kompilieren?

lg, deräppel
 
Zuletzt bearbeitet:

tharwan

Englischer Kantapfel
Registriert
01.09.07
Beiträge
1.085
ich würde sagen da hast du irgendwas beim anlegen des projektes falsch gemacht.
du brauchst ein commandline utility >> standart tool oder foundation tool
 

MacMark

Jakob Lebel
Registriert
01.01.05
Beiträge
4.874
Mach mal "new project" und schau Dir an, was "C++" im Namen trägt. Abhängig davon, ob mit oder ohne GUI, gibt es verschiedene C++-Projekte.