Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7631803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:26:52+00:00 2026-05-31T06:26:52+00:00

Hey all im not sure if ive made a syntactical error hear but ive

  • 0

Hey all im not sure if ive made a syntactical error hear but ive made a class and get this error when i try to compile it….

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

it works fine with g++ but i have to use gcc…

this is the 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
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T06:26:53+00:00Added an answer on May 31, 2026 at 6:26 am

    gcc defaults to compiling your program as C. Since it’s a C++ program, that’s not going to work. Use the -x c++ flag, or rename your file to have a .C (case is important) or .cpp extension.

    Edit: actually, you can use a whole bunch of filename extensions to indicate that your program is C++. From this link:

    .cc, .cp, .cxx, .cpp, .c++, .C

    Edit 2: Your comment below makes me think you’re trying to put the header file on the command line. Don’t do that. Just compile source files and include the headers as necessary.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all, I've seen a lot of topics on this, but not quite what
Hey guys I'm not sure if I'm going about all this the right way.
Hey guys I'm not sure how to phrase this to get the correct search,
hey all when installing my app to the emulator I get this: ERROR/AndroidRuntime(465): java.lang.RuntimeException:
Hey, can someone help me make this an object please. Obviously not all my
Hey all, simple question I'm sure, but I would like to have the body
Hey all i am trying to figiure out why my code is not triggering
Hey all, my Computational Science course this semester is entirely in Java. I was
Hey all, I'm pulling my hair out on this one. I've checked all my
Hey all this is the first time i am calling a stored procedure via

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.