CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Multiple Source Files

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
barkerben



Joined: 19 Jan 2006
Posts: 22

View user's profile Send private message

Multiple Source Files
PostPosted: Sun Jan 22, 2006 3:56 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Jan 22, 2006 4:16 pm     Reply with quote

See this thread:
http://www.ccsinfo.com/forum/viewtopic.php?t=18649
barkerben



Joined: 19 Jan 2006
Posts: 22

View user's profile Send private message

PostPosted: Sun Jan 22, 2006 4:20 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group