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

MPLAB x CCS

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



Joined: 27 Sep 2007
Posts: 3

View user's profile Send private message

MPLAB x CCS
PostPosted: Thu Sep 27, 2007 12:28 pm     Reply with quote

HI Folks !

I have a problem, i couldn´t find the solution on old posts.

I am trying to use CCS under MPlab, I have two .C files, and 3 .H files. When i use only CCS, i MUST set Option>Project Option>and select "Multiple compilation units" and "Link Separately", so far... so good.
No problem.

IF i don´t do that, i got a error
--- *** Error 112 "teste.c" Line 344(1,1): Function used but not defined: ... lcd_init SCR=636 ---

Well, when under MPlab i got the same error :
Error[112] teste.c 344 : Function used but not defined: ... lcd_init SCR=636

How can solve this? Is there any way, to set Multiple copilation ..... under Mplab ??

Thanks in advance.

Claudio.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 27, 2007 1:45 pm     Reply with quote

Do you have to use Multiple compilation units ?

Try doing it the traditional CCS way. Just add the main C source file
to the MPLAB project. Don't add any other source files to the project.
Then use #include statements in the main C source file to include all
other .c and .h files. We know that this method works.
card_claud



Joined: 27 Sep 2007
Posts: 3

View user's profile Send private message

PostPosted: Thu Sep 27, 2007 2:07 pm     Reply with quote

PCM programmer wrote:
Do you have to use Multiple compilation units ?

Try doing it the traditional CCS way. Just add the main C source file
to the MPLAB project. Don't add any other source files to the project.
Then use #include statements in the main C source file to include all
other .c and .h files. We know that this method works.



Well, isn´t it what am i doing?
I have a main.C file. Into it i have some includes:
#include <16F870.h>
#include "IO.h"
#include "display4x20.h"

I have another .C file : display4x20.c", and into it i have:
#include <16F870.h>
#include <IO.h>

If i DON´T select "Multiple compilation units" and "Link Separately" in CCS , i got error message. IT´s without Mplab, only in CCS.
If selected, no problem.

When i try to use the MPlab, the project got error, the same erros that i commented above (without selected " Multiple.....").
In my mind, i am thinking that i have to select "Multiple compilation units" and "Link Separately" also into MPlab, but how ?

I really don´t understand, so sorry my friend, and if you can, try to explain me. Please.
thanks
Claudio.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 27, 2007 2:18 pm     Reply with quote

See my post in this thread which shows how to organize the main
source file:
http://www.ccsinfo.com/forum/viewtopic.php?t=18649

See my first post in this thread, which shows how the Project Window
in MPLAB should look:
http://www.ccsinfo.com/forum/viewtopic.php?t=27115

See this thread for info on how to add the additional source files
to the "Other Files" section in the MPLAB Project Window:
http://www.ccsinfo.com/forum/viewtopic.php?t=25826
card_claud



Joined: 27 Sep 2007
Posts: 3

View user's profile Send private message

PostPosted: Thu Sep 27, 2007 2:51 pm     Reply with quote

OK, when i did all instructions that you give me, it works under MPLAB.
Great !

---------------------------------------------------------------------------------------
But please let me understand, i just learning C language, so sorry about how stupid i am. But many people told me that i must put only includes .H inside my main.C, and then the linker will do the service.

I have been trying, and a only got success when in CCS i did that i told you in the last post. And it did well !
So why into the MPLAB i don´t get the same result ?

You said here http://www.ccsinfo.com/forum/viewtopic.php?t=18649
That CCS doesn't have a LINKER, is the difficult that i have because that ?

Claudio
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Sep 27, 2007 3:06 pm     Reply with quote

Supposedly it works in version 4.xxx of the PCWH IDE compiler, but
I don't have that version of the compiler, so I have not tested it.

I use the command line compilers with MPLAB.
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