Error running make - array type has incomplete element type

I am trying to install libbow library. When i run make file the following error is generated

gcc -c -Ibow -I. -I./argp -DHAVE_LIBNSL=1 -DHAVE_STRERROR=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_RANDOM=1 -DHAVE_SRANDOM=1 -DHAVE_SETENV=1 -DHAVE_STRCHR=1 -DHAVE_STRRCHR=1 -DHAVE_ALLOCA_H=1 -g -O -Wall -Wimplicit -o array.o array.c
In file included from array.c:22:
./bow/libbow.h:2128: error: array type has incomplete element type
make: *** [array.o] Error 1

The Source of libbow is : (The latest version)

Search results showed it as a compiler problem. How to resolve this? Or is there any other source for libbow?

1

1 Answer

The error points line 2128 of bow/libbow.h

extern struct argp_child bow_argp_children[]; 

It means that struct argp_child is not defined.

I noticed that in line 1346 there is a forward declaration of the structure.

struct argp_child; /* forward declare this type */

The full declaration of the structure is in line 245 of argp/argp.h

To resolve this issue you can either

  • Use include of argp.h in libbow.h

    i.e #include "../argp/argp.h"

  • Copy struct argp_child definition in libbow.h (not recommended)

An other thought is that you might compiling array.c from wrong directory and -Ibow -I. -I./argp does not point to the correct directories.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like