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

MPLAB setup with multiple C files... but compile only main.c

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



Joined: 11 Jan 2004
Posts: 45

View user's profile Send private message Visit poster's website

MPLAB setup with multiple C files... but compile only main.c
PostPosted: Mon Jan 30, 2006 3:37 pm     Reply with quote

I have multiple .c files in my project.
So, i added them all to a project in MPLAB. The problem is when you do a build command it automatically builds every C file in the Source directory in a project.

So, i could use MPLab if i removed all the .c files or if i renamed them all to .h.

Removing them all makes it kind of a pain in the butt to edit them if i need to. As i wouldn't be able to double click on the file i need over in the project explorer.

Renaming them all to .h would be kind of inconvenient and i was thinking i may run into other problems with doing that... that i haven't thought about.

Is there really no way to specify that the build command will only build main.c or some other clever way to use MPLab with CCS? I have read several threads on the discussion and it seems that everyone just doesn't add all the source files to the project and was hoping for a better solution.
Kasper



Joined: 14 Jan 2004
Posts: 88
Location: Aurora, Ontario, Canada

View user's profile Send private message Visit poster's website

PostPosted: Mon Jan 30, 2006 3:48 pm     Reply with quote

What you need is a linker, which, last I saw was only in limited beta test.

With multiple C files, include them with include statements instead and make sure just one C file is listed in mplab under source files.

#include "somefile.c"
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jan 30, 2006 4:11 pm     Reply with quote

Quote:
As i wouldn't be able to double click on the file i need over in the project explorer.

Add the additional C source files to the "Other Files" section in MPLAB
in the Project Navigator window.
blak3r



Joined: 11 Jan 2004
Posts: 45

View user's profile Send private message Visit poster's website

PostPosted: Mon Jan 30, 2006 4:57 pm     Reply with quote

good call pcm.

That's a simple solution. I thought it would filter it back up into the source files directory just like it does if you try to add a .c file to the header files directory.

~blake
_________________
"Everything should be made as simple as possible, but not one bit simpler" -- Albert Einstein

http://www.blakerobertson.com
oldnewbie



Joined: 07 Dec 2007
Posts: 2

View user's profile Send private message

PostPosted: Fri Dec 07, 2007 9:59 am     Reply with quote

Thanks PCM - great info. How does this information get back to CCS/Microchip so that they at least document this trap for newbies....?
zzeroo



Joined: 17 Jun 2013
Posts: 18

View user's profile Send private message

PostPosted: Sat Oct 05, 2013 2:58 am     Reply with quote

I think "other files" are now "Important Files" in newer MPLABX versions. But it is working like before I think.
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