View previous topic :: View next topic |
Author |
Message |
blak3r
Joined: 11 Jan 2004 Posts: 45
|
MPLAB setup with multiple C files... but compile only main.c |
Posted: Mon Jan 30, 2006 3:37 pm |
|
|
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
|
|
Posted: Mon Jan 30, 2006 3:48 pm |
|
|
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
|
|
Posted: Mon Jan 30, 2006 4:11 pm |
|
|
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
|
|
Posted: Mon Jan 30, 2006 4:57 pm |
|
|
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
|
|
Posted: Fri Dec 07, 2007 9:59 am |
|
|
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
|
|
Posted: Sat Oct 05, 2013 2:58 am |
|
|
I think "other files" are now "Important Files" in newer MPLABX versions. But it is working like before I think. |
|
|
|