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

  • SEARCH
  • Home
  • 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 7857149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:56:53+00:00 2026-06-02T20:56:53+00:00

I made a class and split it into a source and header file, but

  • 0

I made a class and split it into a source and header file, but I can’t get them to talk to each other.

My header file, GridLayout.h that looks something like this:

#ifndef GRIDLAYOUT_H_INCLUDED
#define GRIDLAYOUT_H_INCLUDED

#include <vector>
#include <types.h>
#include "GridPlaceable.h"

namespace Spaceships {

class GridLayout {
    //consider replace with std::list
    typedef std::vector<GridPlaceable*> column;

    public:
        GridLayout();
        ~GridLayout();

        void arrange();
        void splitColumn(size_t colNo, distance position);
        void splitRow(size_t rowNo, distance position);
        bool placeOne(GridPlaceable* thatOne);

private:
        bool tryToFit(GridPlaceable* thatOne, size_t startCol, size_t startCell);

        std::vector<column> wholeGrid;
        std::vector<GridPlaceable*> toPlace;

        std::vector<distance> rowHeights, colWidths;
        std::vector<size_t> firstEmpties;

        bool mandates;
};

};

GridLayout.cpp looks like:

#include "GridLayout.h"

namespace Spaceships {

GridLayout::GridLayout() {

}

//GridLayout::aBunchOfOtherFunctions() { }

}

#endif

When I compile, I get a whole slew of GridLayout does not name a type errors. What could be causing this? I seem to remember solving a similar problem once by throwing in a bunch of semicolons, but that doesn’t seem to be working this time.

  • 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-06-02T20:56:55+00:00Added an answer on June 2, 2026 at 8:56 pm

    Figured it out! I’ll put this here in case it helps somebody.

    I must have set GridLayout.h to be compiled at some point, then changed it back, because there was a GridLayout.gch lying around in the directory. So the compiler must have gone straight for that and ignored the .h altogether. I deleted that file and now it shows me all the real errors in my code.

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

Sidebar

Related Questions

So, I made a class that takes arrays and calculates a value from them.
How can I unit test my NSURLConnection delegate? I made a ConnectionDelegate class which
I made a class library, and put it in GAC. It has one C#
I made a class which looks something like. class NewInt: def __init__(self, x,y): self.holders
I have made an class which conforms to the NSCoding protocol and does all
I am learning C++ and I have a question. I made a class in
I made a form class in c# that has a devexpress grid, a label
I made a music class that will play a song. I have made onResume
I have made a Java class where I have defined a constructor and some
I've made an custom UILabel class in which i draw a red line at

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.