Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change syntax of a declaration

Status
Not open for further replies.

gregor weertman

Programmer
Sep 29, 2000
195
0
0
NL
Hello,

I’m trying to compile Zabbix on HP-UX not disturbed by any knowledge of c.

The syswait.h gives an error when I compile it with gcc.
(Zabbix has to be compiled with gcc in my case)

The line on which the error occurs is:

extern struct syswait syswait[];

the error message:
error: array type has incomplete element type

seems like an syntax error.

When I put the line in a simple C program and compile whith cc
It compiles ok.

Can I change the syntax of that line for compilation whith gcc?
 
You should really use the home forum for this kind of question.

That is after all where you will find the highest concentration of people with the most knowledge about the software.

> [tt]extern [red]struct syswait[/red] syswait[];[/tt]
The problem is that so far the compiler has only seen
[tt]struct syswait;[/tt]
that is, it knows a structure with that name exists somewhere.

What the compiler hasn't seen, but needs is
[tt]struct syswait {
/* members of struct */
};[/tt]



--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
Thanks for your responce.
THe call is already a few weeks on zabbix.
Posted by someone else.
no answer yet.

Your explination helps so far that I copied a peace of code from sar.h to sysinfo.h

/* begin sar.h copy */
struct syswait {
long iowait;
#ifdef __LP64__
uint32_t pad[6]; /* long is 8 bytes on LP64 */
#else
uint32_t pad[7]; /* Fill to max cacheline (32) */
#endif
};

/* end sar.h copy */

extern struct syswait syswait[];

now there are no compilation errors and the appication runs.
however it is not communicating with the zabbix server.

Your explination however brought me a little in the right direction.

THANKS!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top