My object has an incomplete type?

So I'm trying to create a program where I can create an account for whatever and set a password for it. I'm more or less of a newbie at coding in c++, so this is kind of a long shot and I doubt I'll be able to make this work, but hey, whateves. But the error I'm currently working with is this bit of code here. I have a class called Account and I'm trying to make an object for it, like so:
Account AccountObj;

But the error I get is like so:
error: aggregate 'Account AccountObj' has incomplete type and cannot be defined


What could possibly be happening?
Please post a the full Account header or whatever it is declared in :)
You have not shown your class definition so I can only guess that its definition has a member with incomplete type/ For example

1
2
3
4
5
6
struct A;

struct B
{
   A a;
};


Here class B has member a with incomplete type because class A was not defined yet. Or another example

1
2
3
4
struct A
{
   int arr[];
};


Here class A also has a member with incomplete type because the size of the arr is not specified.
Oook, so chances are that its a problem with my account class? should I post my whole class or just this:
#include "Account.h.h"

I think I might have named my class 'Account.h' by complete accident, but whenever I make an object of the class like this:
Account.h accountObj;

It doesn't work. I'm so very confuzed.
Please tell me if I should post my whole program.
Why do you use two extensions for the header file?

You should show your class definition that is all its member declarations between open and closing braces.
Last edited on
Sorry, haha I might be a lot newer than you think. what are extensions for the header file?

whats the class definition?

I can post the whole program if you want me to...
Oh nvm I just fixed it haha thnx for trying guys!
Topic archived. No new replies allowed.