🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: alt.msdos.programmer
2 messages
2 total messages Started by Raoul Said Thu, 10 Sep 1992 21:41
Setting up a project in TC++
#287
Author: Raoul Said
Date: Thu, 10 Sep 1992 21:41
6 lines
886 bytes
	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.
Re: Setting up a project in TC++
#288
Author: Norman Lin
Date: Fri, 11 Sep 1992 00:34
19 lines
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads