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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:43:35+00:00 2026-05-26T16:43:35+00:00

I am trying to get a project to compile, and I am running into

  • 0

I am trying to get a project to compile, and I am running into a problem with incomplete types. Here is the output from make:

In file included from ../common/ClientCommunication.h:13,
                 from EchoService_stub.h:9,
                 from EchoService_stub.cpp:1:
../common/Naming_stub.h:16: error: field ‘clientCommunication’ has incomplete type
In file included from EchoService_stub.h:9,
                 from EchoService_stub.cpp:1:
../common/ClientCommunication.h:20: error: field ‘serverEndpoint’ has incomplete type
make: *** [EchoService_stub.o] Error 1

Here are my header files in question:

In Naming_stub.h:

ifndef NAMING_STUB_H__
#define NAMING_STUB_H__

#include <string>
#include <string.h>
#include "Naming.h"

class ClientCommunication;

class Naming_stub : public Naming {

private:
  ClientCommunication clientCommunication;

protected:
  // Protected Methods Here.

public:                                    
  // Public Methods Here.
};
#endif

In Naming.h

#ifndef NAMING_H__
#define NAMING_H__

#include "Remote.h"
#include "../util/RemoteException.h"

class Naming {
private:
protected:
public:

  virtual Remote* lookup(std::string lookupURL) throw (RemoteException);

  virtual void bind() throw (RemoteException);

  ~Naming();
};

#endif // NAMING_H__      

Finally, there is the ClientCommunication.h file:

#ifndef CLIENT_COMMUNICATION_H__
#define CLIENT_COMMUNICATION_H__

#include <iostream>
#include <cstdlib>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include "../util/RemoteTypes.h"
#include "Naming_stub.h"

struct Endpoint;

class ClientCommunication {
private:
  int socket_fd;
  struct Endpoint serverEndpoint;

protected:

public:
  ClientCommunication(const struct Endpoint& serverEndpoint_in);
  struct Buffer send(struct Buffer& callBuffer);
  ~ClientCommunication();
};

#endif // CLIENT_COMMUNICATION_H__

Sorry that this is so long, but there is one more header file. The Endpoint struct is declare in RemoteTypes.h, which looks like the following:

#ifndef REMOTE_EXCEPTION_H__
#define REMOTE_EXCEPTION_H__

#include <netinet/in.h>

struct Endpoint {
  int port;
  char* service_id;
  char* server_ip;
  struct sockaddr_in host_name;
};

struct Buffer {
  char* contents;
  int size;
};

#endif

Thanks!

  • 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-26T16:43:36+00:00Added an answer on May 26, 2026 at 4:43 pm

    You cannot declare a field using an incomplete type. You have to declare a pointer instead.

    private:
      ClientCommunication clientCommunication; // requires #include
      ClientCommunication *clientCommunication; // works with incomplete type
    

    Otherwise, you have to include the client communication header in the first header.

    ifndef NAMING_STUB_H__
    #define NAMING_STUB_H__
    
    #include "ClientCommunication.h"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to compile code from an open source project, and I'm running into
I have been trying for days to get a Qt project file running on
I am having trouble trying to get NAnt to compile my project, which consists
I am trying to get a logging project up and running and having difficulties
I'm trying to switch our build from CruiseControl.NET running a custom .msbuild file to
I have a NetBeans project that I'm trying to compile manually from command-line ant
I'm trying to get command line input into a running java program that I
i am trying to get notifications for a small project of mine using setTimeout
I'm trying to get MSBuild working on a project that has just been moved
I'm trying to get a new Enterprise Application Project set up in Eclipse using

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.