Kompilieren einer Klasse mit GCC

Hey, ich bin nicht sicher, ob ich machte eine syntaktische Fehler hören, aber ich machte eine Klasse und bekomme diese Fehlermeldung, wenn ich versuche zu kompilieren....

dining.h:7:1: error: unknown type name class
dining.h:7:17: error: expected ‘=’, ‘,’, ‘;’, asm or __attribute__ before ‘{’ token

funktioniert es mit g++, aber ich habe mit gcc...

dies ist das problem-code..

#ifndef DINING_H
#define DINING_H

class DiningSet {

    public:
        DiningSet();
        ~DiningSet();
        void getSize(); //accepts X and Y dimentions of the table (in metres)
        //void surfaceArea(int,int);    //Calculates Surface Area of table (in square metres)
        void numChairs();   //accepts number of chairs
        void cushionColour();   //accepts a cushion colour
        void woodType();    //accepts wood type
        void priceComp();   //computes a price of set
        void purchaseDet(); //displays details of purchase
        void purchasePrice();   //displays price of purchace

    private:
        int X, Y; //Dimentions of table
        float Surface;
        int chairs; //Number of chairs
        char colour; //colour of cushion (should be dynamic array)
        char wood;
        float totalPrice;   
};


#endif
  • Bitte weisen Sie den Befehl Linie, die Sie gerade verwenden.
Schreibe einen Kommentar