Article View: alt.msdos.programmer
Article #288Re: Setting up a project in TC++
From: Norman Lin
Date: Fri, 11 Sep 1992 00:34
Date: Fri, 11 Sep 1992 00:34
19 lines
1476 bytes
1476 bytes
saidra@prism.CS.ORST.EDU (Raoul Said) writes: > I would like to know the best way to set up include files in a project. >The problem I have is that say I make a module called foo.c which the main.c >uses. In main.c I say #include "foo.h" and foo.c is also listed in the project >file. But since I also include foo.h within foo.c the compiler says there >are duplicate declarations! Am I doing something wrong? I need the info in >foo.h for both main.c and foo.c, how do I do this? Thanks. It sounds as if you're declaring variables in your header file. You probably shouldn't do this; the header file usually needs only contain such information as #defines, prototypes, and structure tag definitions. Actual variable declarations in a header file would be (I think) unusual, and this sounds like the problem you're having. Declare the variables in main.c and/or foo.c, not in the header file. Hope this helps, Norman
Technical Details
Message-ID:
<1992Sep11.003452.4840@constellation.ecn.uoknor.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!convex!constellation!midway.ecn.uoknor.edu!norlinReferences:
<1992Sep10.214157.18067@CS.ORST.EDU>Show Full Headers
Complete Article Headers
Newsgroups: alt.msdos.programmer Path: arc1-ca.pugleaf.net!sparky!uunet!cs.utexas.edu!convex!constellation!midway.ecn.uoknor.edu!norlin From: norlin@midway.ecn.uoknor.edu (Norman Lin) Subject: Re: Setting up a project in TC++ Sender: usenet@constellation.ecn.uoknor.edu (Usenet Administrator) Message-ID: <1992Sep11.003452.4840@constellation.ecn.uoknor.edu> Date: Fri, 11 Sep 1992 00:34:52 GMT References: <1992Sep10.214157.18067@CS.ORST.EDU> Organization: Engineering Computer Network, University of Oklahoma, Norman, OK, USA Lines: 19