View previous topic :: View next topic |
Author |
Message |
card_claud
Joined: 27 Sep 2007 Posts: 3
|
MPLAB x CCS |
Posted: Thu Sep 27, 2007 12:28 pm |
|
|
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
|
|
Posted: Thu Sep 27, 2007 1:45 pm |
|
|
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
|
|
Posted: Thu Sep 27, 2007 2:07 pm |
|
|
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
|
|
|
card_claud
Joined: 27 Sep 2007 Posts: 3
|
|
Posted: Thu Sep 27, 2007 2:51 pm |
|
|
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
|
|
Posted: Thu Sep 27, 2007 3:06 pm |
|
|
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. |
|
|
|