Re: problem with multiple source file



pereges <Broli00@xxxxxxxxx> writes:

On Apr 8, 7:05 pm, Ben Bacarisse <ben.use...@xxxxxxxxx> wrote:
pereges <Brol...@xxxxxxxxx> writes:
I hae compiled and executed codes of vector.c, reader.c , test.c
seperately and they can be execute in proper manner and give correct
outputs but when i tried to integrate them all into a single project
using pelles C it is giving two many errors.

You could help people out with an error message!

You have got tied up in includes, trying to get common.h to do
everything.
<snip>
I could post error messages but theres just way too many.

The first one is (almost) always the most revealing one.

I think
change my approach. In my project, vector data structure and
operations are meant to be seen by every module so I will put that it
into common.h along with some common header files like stdio, stdlib ,
string and math which are needed almost every module. Suppose

all.h

a.h a.c
b.h b.h
c.h c.c

Now each of the .h's file should include all.h and every .c file will
include its corresponding .h file. I think then in main.c you need to
include all the headers including all.h

I don't see why you object to just including in each .c file what is
needed by that .c file. That is my preferred method for programs of
this sort of size.

There are times when a well organised program can have "grouped" .h
files that pull in related sets of types and functions, but your
program is not at that sort of size yet.

This is just a suggestion. You've got tied up once already, so why
not try the plain method first. You may like it.

--
Ben.
.



Relevant Pages

  • Re: D3/Linux program abort
    ... same sort of fire could occur anywhere. ... Most developers are ... error message so that we can get through diagnostics quickly and get ... There's also the "techno error" that developers tend to display when ...
    (comp.databases.pick)
  • Re: D3/Linux program abort
    ... The fire is out and the trucks have left the scene, ... same sort of fire could occur anywhere. ... Most developers are ... error message so that we can get through diagnostics quickly and get ...
    (comp.databases.pick)
  • Re: error message when sorting in Excel
    ... Exactly how are you doing the sort? ... The error message is as follows: ... Crashed Module Name: Microsoft Excel ...
    (microsoft.public.mac.office.excel)
  • Re: cant receive-norton update issue
    ... > What happens if you completely uninstall all Symantec software? ... >> error message. ... This is sort of turning into a Norton question, ... >> was wondering if anyone else encountered this while trying to fix their ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: problem with multiple source file
    ... outputs but when i tried to integrate them all into a single project ... using pelles C it is giving two many errors. ... You could help people out with an error message! ... into common.h along with some common header files like stdio, stdlib, ...
    (comp.lang.c)