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 7917295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:05:49+00:00 2026-06-03T15:05:49+00:00

Im not sure why I am getting this error…error: field ‘config’ has incomplete type.

  • 0

Im not sure why I am getting this error…”error: field ‘config’ has incomplete type”. I have tried to do forward declaration and including the headers using #include…Im just trying to include fConfig in fInstance…

#ifndef FINSTANCE_H
#define FINSTANCE_H

//#include "fConfig.h"
#include <vector>
#include <sys/types.h>
#include <string>

using namespace std;

class fConfig;

class fInstance
{
public:
    pid_t pid;
    fConfig config;
    vector<string> notes;
    vector<time_t> times;

    fInstance();
    virtual ~fInstance();
};

#endif // FINSTANCE_H





#ifndef FCONFIG_H
#define FCONFIG_H

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <sys/types.h>
#include <fcntl.h>
#include "JWDSFork.h"
#include "fInstance.h"

using namespace std;

class fConfig
{
    private:
        pid_t pid, w;

    public:
        pid_t cPid;
        string name;

        int group;
        int instanceId;
        int numInstance;
        int tries;

        bool reply;
        bool debug;
        bool service;
        bool currentlyRunning;

        time_t startTime;
        time_t endTime;

        string path;

        fConfig();
        virtual ~fConfig();

        void start();
        string intToString(int);
        char* stringToChar(string);
};

#endif // FCONFIG_H

EDIT: Added changes

#ifndef FINSTANCE_H
#define FINSTANCE_H

#include "fConfig.h"
#include <vector>
#include <sys/types.h>
#include <string>
using namespace std;

//class fConfig;

class fInstance
{
public:
    pid_t pid;
    fConfig* config;
    vector<string> notes;
    vector<time_t> times;

    fInstance();
    virtual ~fInstance();
};

#endif // FINSTANCE_H




#ifndef FCONFIG_H
#define FCONFIG_H

#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <cstring>
#include <sys/types.h>
#include <fcntl.h>
#include "JWDSFork.h"
//#include "fInstance.h"

using namespace std;

class fConfig
{
    private:
        pid_t pid, w;

    public:
        pid_t cPid;
        string name;

        int group;
        int instanceId;
        int numInstance;
        int tries;

        bool reply;
        bool debug;
        bool service;
        bool currentlyRunning;

        time_t startTime;
        time_t endTime;

        string path;

        fConfig();
        virtual ~fConfig();

        void start();
        string intToString(int);
        char* stringToChar(string);
};

#endif // FCONFIG_H
  • 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-03T15:05:51+00:00Added an answer on June 3, 2026 at 3:05 pm

    You need to add #include "fConfig.h" in fInstance.h and you don’t need to include fInstance.h in fConfig.h because it appears that you are not using the type fInstance in fConfig.h.

    When you forward declare a type compiler doesn’t know the memory layout of that type and so it treats the type as an Incomplete type & the compiler cannot do any operations for which it needs to know the memory layout of that type.

    You create an instance of fConfig after forward declaring it, to do that compiler needs to know the memory layout of fConfig but since you just forward declared it, it doesn’t know that and hence complains.

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

Sidebar

Related Questions

Not sure why I'm getting this error. I have the following: int* arr =
OK have just started getting this error and I'm not sure why. I have
I am not sure why I am getting this error message. I have a
Hello not sure why Im getting this error. Basically I get it in these
Not sure why I'm getting this error and can't figure it out? The cycle
I'm not sure why I'm getting this error that's terminating my connection. I updated
I'm not sure why I'm getting this error, but shouldn't this code compile, since
i am not sure why i am getting this error i created a regular
As the title states, I'm not sure why I'm getting this error. I've put
Not sure why I am getting this error in my logs. This error happens

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.