Sujet : Re: question about linker
De : bc (at) *nospam* freeuk.com (Bart)
Groupes : comp.lang.cDate : 02. Dec 2024, 22:53:55
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vila9j$3j4dg$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
User-Agent : Mozilla Thunderbird
On 02/12/2024 21:16, David Brown wrote:
On 02/12/2024 20:12, Bart wrote:
On 02/12/2024 18:23, Janis Papanagnou wrote:
On 02.12.2024 16:24, David Brown wrote:
On 02/12/2024 13:24, Bart wrote:
[...]
>
That sounds like you have a very poor organisation of your files. [...]
>
A suspicion that I got as well (also from other posts of him).
>
Then you'd both be wrong. DB's remark was anyway a misunderstanding.
>
My projects have all relevant modules, usually measured in dozens, in the same folder.
>
Oh, dozens of modules! I never realised your programs were that big!
In my current project, there are 155 C files, 44 C++ files, 272 header files, and 5 linker files over 71 directories. Most of the C files and a substantial proportion of the headers are libraries and SDKs for the device in use, most of the C++ files were written by me, but some were written by four other developers at the same time.
When you work with more serious projects, you need a better organisation than you do for little one-man hobby programs.
So, how would you have organised the 16-module example I posted elsewhere? (Not a C project, these are 16 source files, so no headers etc.)
Because two posters here have suggested my organisation is poor, but without knowing how big, small, or complex my projects are.
BTW your project doesn't sound that big, especially if you have a penchant for having a larger number of smaller files.
A line-count would give a better idea.
The largest C project I attempted to build (with my compiler) was the Seed7 language a few years ago. I think there were 130-odd .c files, probably a comparable number of header files.
It took my compiler 1-2 seconds to build from scratch, producing I think a 1.6MB executable. (That project is notable for coming with nearly 20 different makefiles, tuned for different compilers and platforms.)
The current version includes 176 .c files and 148 .h files (not all used in any one configuration), which are all kept in one ./src folder. About 190Kloc in all.
I guess that's poorly organised too? It sounds like everybody else's projects are!