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 support@ccsinfo.com

multi files

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








multi files
PostPosted: Thu Jun 05, 2008 5:44 am     Reply with quote

I am working on a program with a main.c file which has several includes for other .c, .h and .reg files.

I then call routines in the other files from the main file.

I am not reliably able to include the files in my project. I seemed have achieved this is some cases more by luck than skill.

Files that main can access are in the project list, other are not and I don't seem to be able to add them.

Any ideas?

CCS version 4.71
pic18f8722

regards
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 05, 2008 7:19 am     Reply with quote

See the links at the end of this thread.
http://www.ccsinfo.com/forum/viewtopic.php?t=34957&highlight=multiple+files+mplab


Quote:
CCS version 4.71

Your version is actually 4.071.
Guest








multi files
PostPosted: Thu Jun 05, 2008 8:59 am     Reply with quote

Thanks for the info.

Do I have to use MPLAB to solve my problen or can I use just the CCS compiler.

I ask this as I have a seperate issue with MPLAB, I can't get it the recognize compiler.

So, if I can use just compiler I will sort that problem first, then MPLAB.

Regards
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 05, 2008 10:46 am     Reply with quote

Look at the column headings on this page. Which compiler do you have ?
http://www.ccsinfo.com/content.php?page=ideoverview
Guest








Multi files
PostPosted: Thu Jun 05, 2008 10:56 am     Reply with quote

I have PCWH 4.071.

This should do multiple compilation.

Regards
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jun 05, 2008 10:59 am     Reply with quote

Are you talking about "Multiple compilation units" as shown on here:
http://www.ccsinfo.com/content.php?page=ideoverview#multiple

I don't have the CCS IDE compiler (PCW, etc.). I only have the
command line compilers which I use with MPLAB. So I can't help
you with multiple compilation units.
Guest








PostPosted: Thu Jun 05, 2008 11:09 am     Reply with quote

Quote:
Are you talking about "Multiple compilation units" as shown on here:



Yes.

Thanks for looking anyway.

Perhaps someone else may help.

Best regards
Ken Johnson



Joined: 23 Mar 2006
Posts: 197
Location: Lewisburg, WV

View user's profile Send private message

PostPosted: Thu Jun 05, 2008 12:44 pm     Reply with quote

I've just managed to build a small project with "multiple compilation units".

Under menu "Options/Project Options/Files", check both "Multiple Compilation Units" and "Link Separately". Then next to "Source Files, click "Add".

Later, when you return to this dialog, the .c files show up as .o files - confusing.

But this has worked for me. Hope this helps Smile

Ken
Guest








multi files
PostPosted: Sat Jun 07, 2008 12:15 am     Reply with quote

Thanks for your comments.

I built a small project as a test too, and it worked fine.

My main project has about ten of my includes and it may be this number thats causing the problem.

I will continue to investigate.

Best regards,
Franck26



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

PostPosted: Wed Jun 11, 2008 7:03 am     Reply with quote

Hi Ken,
The multi compilation unit is working with CCS IDE???
I tried it many times and never succeed...

Several times I was able to compile, but never able debug with the ICD2:
“Clock and Connection Review” windows which show up after loading...

Do you use the CCS ICD2?

Thanks for any response.
KU5D



Joined: 10 Feb 2008
Posts: 46
Location: Asheville, North Carolina

View user's profile Send private message

PostPosted: Wed Jun 11, 2008 10:13 am     Reply with quote

I also ran into this when I first started using this compiler. Most of my projects have multiple files, which makes modules easier to use in multiple projects. Some projects have ten files or more. The important thing is to make sure you include the files in your main in the correct order. You cannot have any call to a function unless the order in which they are compiled defines the function before it is called.

I use the CCS IDE version 3.249 and the CCS compiler.
_________________
Confidence is the feeling you have right before you fully understand the situation...
Franck26



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

PostPosted: Wed Jun 11, 2008 12:36 pm     Reply with quote

Hi KU5D,
Are you sure you are using a "multi compilation unit" project?
Because in another post Kender explained me that the "multi compilation unit" option was not available before V4...

I think you are including your .c files directly in the main file so for the compiler it's like one big file and it's very different than a multi compilation.

About your problem of including the file in the good order, I think that it's because you are not writing the prototype of the function in the appropriate .h file. For each .c file you need to have at least one .f file which will be include in the other .c files.

Regrads,
Franck.
KU5D



Joined: 10 Feb 2008
Posts: 46
Location: Asheville, North Carolina

View user's profile Send private message

PostPosted: Wed Jun 11, 2008 12:51 pm     Reply with quote

Most likely I misinterpreted the original question. I thought we were simply trying to use multiple source files (which does appear to the compiler as one big 'main').
_________________
Confidence is the feeling you have right before you fully understand the situation...
Franck26



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

PostPosted: Wed Jun 11, 2008 1:04 pm     Reply with quote

You couldn't know: this option is not available with your version.
Neither in the V4 in fact, since it's not working!!! Shocked

Regards,
Franck.
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