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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T17:02:55+00:00 2026-05-14T17:02:55+00:00

gcc lovingly throws me this error: bst.c:33: error: invalid application of ‘sizeof’ to incomplete

  • 0

gcc lovingly throws me this error:

bst.c:33: error: invalid application of ‘sizeof’ to incomplete type ‘struct BSTNode’

What makes BSTnode incomplete? Below are the struct definitions relevant to BSTnode.

struct BSTnode{

    struct BSTnode * left;
    struct BSTnode * right;

    struct hash minhash;
    struct hash maxhash;

    struct DHTid owner;
    int misses;
};

where we have:

struct hash{
    int hash;
};

struct DHTid
{
    int islocal;

    unsigned long addr;
    unsigned short port;
    struct DHTnode * node;
};

and currently:

struct DHTnode{
    int something;
};

EDIT: My actual code has the following structure:

struct DHTnode{...};
struct hash{...};
struct DHTid{...}; /*changed . to ; in pseudocode*/
struct BSTnode{...};

EDIT: user318466 pointed a missing semicolon, but there was still more wrong with it.

  • 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-14T17:02:55+00:00Added an answer on May 14, 2026 at 5:02 pm

    You declared type struct BSTnode. You are applying sizeof to type struct BSTNode. Note the difference in capitalization: n and N. struct BSTNode is, of course, a completely unknown to the compiler incomplete type, which is what it is telling you.

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

Sidebar

Related Questions

C99 gcc I keep getting this error. I have a struct outside main. And
gcc 4.6.0 c89 I have type of client server application. The server some code
gcc 4.4.3 c89 I am creating a client server application and I will need
gcc 4.4.1 C99 I am creating a client server application. I have a Makefile
GCC gives no error when you initialize a variable-sized array as long as the
// gcc -o 0 $(pkg-config --cflags --libs gtk+-2.0) 1.c #include <gtk/gtk.h> #include <gdk/gdkkeysyms.h> struct
gcc (GCC) 4.6.0 c89 I have a signal handler declared like this: /* Setup
Sometimes GCC generates this instruction when compiling with -march=atom . Does each and every
gcc c89 I am came across this code. typedef __int32 int32_t; typedef unsigned __int32
gcc 4.4.2 I am using these compile options in my Makefile. And my application

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.