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 Files in Project

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



Joined: 08 Mar 2009
Posts: 3

View user's profile Send private message

Multiple Files in Project
PostPosted: Sun Mar 08, 2009 11:30 pm     Reply with quote

How does one add multiple C and H files to a project? I want to organize my source code into groups. For example, I have a main.c file and in there I want to include my driver which consists of driver.c and driver.h. Normally, one would include driver.h but all the examples I've seen are always including the c file which is considered very poor programming practice.

How do I add driver.c and driver.h into the project so I may #include driver.h in my main file?
_________________
http://solar-blogg.blogspot.com
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 09, 2009 12:46 am     Reply with quote

Use the search page. Search for:
Quote:
Multiple files

There are many threads on the topic:
http://www.ccsinfo.com/forum/viewtopic.php?p=110805
solarwind



Joined: 08 Mar 2009
Posts: 3

View user's profile Send private message

PostPosted: Mon Mar 09, 2009 1:45 pm     Reply with quote

PCM programmer wrote:
Use the search page. Search for:
Quote:
Multiple files

There are many threads on the topic:
http://www.ccsinfo.com/forum/viewtopic.php?p=110805

Yes, that would be the obvious thing to do. I would not have posted if I had not already searched and found results.
_________________
http://solar-blogg.blogspot.com
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Mar 09, 2009 1:50 pm     Reply with quote

If you have the IDE version of the CCS compiler, then you can use
"Multiple Compilation Units":
http://www.ccsinfo.com/content.php?page=ideoverview#multiple

If you're using a CCS command line compiler with MPLAB, then you need
to do it as described in the link that I posted.
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