AnsweredAssumed Answered

Link error L1818 when transplanting uc/OS-II to MC9S12C32

Question asked by Wayne Young on May 7, 2009
Latest reply on May 12, 2009 by Wayne Young

I am trying to transplant uC/OS-II to MC9S12C32 with CodeWarrior Development Studio for HCS12(X) Microcontrollers v4.7.1 , after compiling all the codes, I clicked the "make" button and got 51 link error L1818.

Here is an example:

link error: L1818 :smileyfrustrated:ymbol 20 - OSCtxSwCtr duplicated in uCOS_II.C.o and OS_CORE.C.o

 

uCOS_II.C:


#define  OS_GLOBALS                           #include "includes.h"#define  OS_MASTER_FILE                      #include "os_core.c"//#include "os_flag.c"//#include "os_mbox.c"//#include "os_mem.c"//#include "os_mutex.c"//#include "os_q.c"#include "os_sem.c"#include "os_task.c"#include "os_time.c"  

 

And OSCtxSwCtr is defined in uCOS_ii.h:


OS_EXT  INT32U            OSCtxSwCtr; 

 

includes.h:

 


#include    <stdio.h>#include    <string.h>#include    <ctype.h>#include    <stdlib.h>//#include    <conio.h>//#include    <dos.h>#include    <setjmp.h>#include    "os_cpu.h"#include    "os_cfg.h"//#include    "\software\blocks\pc\bc45\pc.h"#include    "ucos_ii.h"

 

 

OSCtxSwCtr appears in OS_CORE.C at three places, and all of them are used as Variables. So I do not know what is wrong.

 

Anyone would help to tell me how to do next?

Outcomes