View previous topic :: View next topic |
Author |
Message |
barkerben
Joined: 19 Jan 2006 Posts: 22
|
Multiple Source Files |
Posted: Sun Jan 22, 2006 3:56 pm |
|
|
My apologies if this is a very basic question...
I'm having some dificulty in working with multiple source code files - how to persuade the compiler to use them. For instance, I have a function main that calls a function I have written, defined in a seperate file. This function is declared in a header file included in the main file, and defined in a c file placed in the project directory. But all my attempts to compile the project complain that the function is declared but not defined...
Also, it seems that, from the manual, the extern command is not supported. This would seem to ause problems for global variables visible across all source files. If I just put them in a header file, they will be declared each time the heder is included, which is bound to give a compiler error. Without se of the extern command, I'm not sure what the solution is...
Cheers, and apologies if I'm being dim,
Ben |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
barkerben
Joined: 19 Jan 2006 Posts: 22
|
|
Posted: Sun Jan 22, 2006 4:20 pm |
|
|
Ah - ok. That makes sense - there is no linker. I don't suppose that really matters though - like the previous thread suggests, multiple source files can just be included together to give one massive one as far as the compiler is concerned.
Cheers,
Ben |
|
|
|