View previous topic :: View next topic |
Author |
Message |
Dimmu
Joined: 01 Jul 2007 Posts: 37
|
multiple compilation units ? |
Posted: Sun May 04, 2008 4:33 am |
|
|
Hello,
Does anybody know if the 'multiple compilation units' is working with the last version of CCS ?
I'm currently working with 4.053 and this feature seems to be unable to manage the types others than the default ones. In the following example, I receives the error code 112 : function used but not defined.
// main.c
Code: | #include "project.h"
#include "func.h"
void main (void) {
A_STR_T VAR_A;
FUNC_A ( VAR_A );
FUNC_B ( &VAR_A );
} |
// project.h
Code: | #include <16F877A.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20mhz)
#use rs232(BAUD=9600, UART1, STREAM=PC) |
// func.h
Code: | typedef struct {int A;} A_STR_T;
// typedef int A_STR_T;
void FUNC_A ( A_STR_T value );
void FUNC_B ( A_STR_T * value ); |
// func.c
Code: | #include <project.h>
#include "func.h"
void FUNC_A ( A_STR_T value ) {
printf ( "A" );
}
void FUNC_B ( A_STR_T * value ) {
printf ( "B" );
} |
If however I replace the definition of "A_STR_T" by the one that is commented in func.h, then the code is compiled |
|
|
Ken Johnson
Joined: 23 Mar 2006 Posts: 197 Location: Lewisburg, WV
|
|
Posted: Mon May 05, 2008 12:51 pm |
|
|
I've not yet had the opportunity to get into this, but expect to soon, as new projects commence. So, I recently asked CCS about multiple compilation units. Their response:
"The compiler does support multiple compilation units and it should work just like you would expect.
Today we can not link to Microchips object files however we expect to be able to do so soon."
Let's hope . . .
Ken |
|
|
Dimmu
Joined: 01 Jul 2007 Posts: 37
|
|
Posted: Tue May 06, 2008 3:28 am |
|
|
Thank you for the feedback,
I hope it's gonna work as they say in new version of the compiler.
Dimmu |
|
|
|