Re: [Dev-C++] header include problem
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Petchesi G. H. <ga...@pr...> - 2005-06-21 20:52:57
|
On Tue, 2005-06-21 at 13:07 +0200, Big Playah wrote:
> Hi,
>
> I'm trying to include pdcurses' panel.h in my project... had to tweak
> it a bit, but then I've tried both to include panel.h and panel.c in
> my project, then made a lib of it, but neither way was succesful.
> everything works just fine until I include the header file only once.
> if I include it from two separate places, I get the following error:
>
> 34 x:\Dev-Cpp\include\panel.h redefinition of `struct panelobs'
=====
To avoid the problem with multiple inclusion of the same header file (if
that is the problem you are having) you have to change the header file
in question to include the following code:
------------------------- panel.h: ---------------------------------
#ifndef __PANEL_H
#define __PANEL_H
/*
* Content of header file. Once defined __PANEL_H we avoid the double
* inclusion of the header file.
*/
#endif
-----------------------------------------------------------------------
gabriel
> the definition in question is:
>
> typedef struct panelobs
> {
> struct panelobs *above;
> struct panel *pan;
> } PANELOBS;
>
> how can I get over this ?
> TIA,
>
> tom
--
Petchesi Gabriel Horatiu <ga...@pr...>
LPS
|