How to add new cstartup file to the IAR RL78 IDE?

I'm using the RL78/D1 series microcontroller and IAR RL78 4.10.1 IDE. My project builds and works fine when I use the default cstartup file(in the IAR directory). But when I add my own cstartup file into my project (I copied the default cstartup file from the IAR directory to my project directory and add it to my project) and complie the project, I get the duplication definition error as follow:

. . .
Linking 
Error[Li006]: duplicate definitions for "@cend"; in "D:\General Basic Software\RL78\CICM16b1\Code\IAR\3- Workspace\Debug\Obj\cstartup.o", and "cstartup.o(dlrlfnf22n.a)" 
Error[Li006]: duplicate definitions for "@cstart"; in "D:\General Basic Software\RL78\CICM16b1\Code\IAR\3- Workspace\Debug\Obj\cstartup.o", and "cstartup.o(dlrlfnf22n.a)" 
Error[Li006]: duplicate definitions for "__INIT_WRKSEG"; in "D:\General Basic Software\RL78\CICM16b1\Code\IAR\3- Workspace\Debug\Obj\cstartup.o", and "cstartup.o(dlrlfnf22n.a)" 
Error[Li006]: duplicate definitions for "__iar_program_start"; in "D:\General Basic Software\RL78\CICM16b1\Code\IAR\3- Workspace\Debug\Obj\cstartup.o", and "cstartup.o(dlrlfnf22n.a)" 
Error[Li006]: duplicate definitions for "__program_end"; in "D:\General Basic Software\RL78\CICM16b1\Code\IAR\3- Workspace\Debug\Obj\cstartup.o", and "cstartup.o(dlrlfnf22n.a)" 
Error while running Linker 
. . .

I did what should I did as the IAR's help tells me, but the problem still exists.

Do you know how can I get rid of this problem?

Thanks

Parents Reply
  • Hello Sai,

    Was there ever any resolution to this issue? I am getting the same linker errors. 

    We have legacy code previously compiled on IAR v2.21.2 that we are attempting to move to v4.21.1. We were using a modified cstartup.s that we copied into our project directory and it was working fine in v2, but gives linker errors in v4.

    The document referenced did not directly address the linker errors; they seem to be a double-defined symbols in cstartup.s which makes me think we need to tell the IDE not to include the original, unaltered, cstartup.s file.

    Any thoughts?

    Thanks,

     Mark

Children