This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Need help: symbol "__TI_int17" redefined

Hi people,

I'm stuck on a linker error. I'm using MSP430 compiler v4.2.2 in CCS 5.1. The console says:


error #10056: symbol "__TI_int20" redefined: first defined in "C:\ti\ccsv5\tools\compiler\msp430_4.2.2\lib\rts430x_lc_sd_eabi.lib<int20.obj>"; redefined in "[MY_PATH]\_hal_teste.lib<msp430xg461x_isr_vector_port_1_2.obj>"


error #10056: symbol "__TI_int17" redefined: first defined in "C:\ti\ccsv5\tools\compiler\msp430_4.2.2\lib\rts430x_lc_sd_eabi.lib<int17.obj>"; redefined in "[MY_PATH]\_hal_teste.lib<msp430xg461x_isr_vector_port_1_2.obj>"


error #10010: errors encountered during linking; "_ex_teste.out" not built


I'm trying to link a static lib to my executable project, and I get that error. When I try to compile all together from source (without linking my library) it goes just fine.

What I understand from it is that the linker thinks I'm redefining the interrupt vectors that where defined before in the rts lib. But isn't it the way to define the ISR vectors?

What can be causing it and how can I proceed?

  • The most likely answer is to change the link order so that your _hal_teste.lib is seen before the compiler RTS lib.  

    When the linker processed the RTS lib, the symbols __TI_int20 and __TI_int17 were referenced and undefined, so the modules int20.obj and int17.obj were brought in from the RTS lib to satisfy those symbol references.  The _hal_teste.lib is processed at some later point.  The module msp430xg461x_isr_vector_port_1_2.obj in _hal_teste.lib must define at least one other symbol not seen here.  Let's call it unknown.  When _hal_teste.lib is processed the symbol unknown is referenced and undefined.  So, the module msp430xg461x_isr_vector_port_1_2.obj is brought in from the library.  However, that same file also defines the symbols __TI_int20 and __TI_int17.  Thus the error message.

    I presume you want the definitions of __TI_int20 and __TI_int17 from _hal_teste.lib and not those from the compiler RTS lib.

    To fix this problem, change the link order so the compiler RTS lib is processed last.  The details are in this wiki article. Search for Link Order.

    Thanks and regards,

    -George

  • Bruno,

    MSP 4.2.x has a new feature for unhandled ISRs where it will plug them using a default ISR TRAP from RTS.

    How are your interrupt vectors defined?  Is that part of the static lib?

    If your interrupt vectors are defined using assembly then change to using the new .intvec directive described in 2.4.3 of slau131h MSP assembly language tools user guide.

    If not using assembly then are you using pragma VECTOR?

    Regards,

    Greg

  • Thanks George, the link order was the point.

    I could change the link order in a way other than the pointed on the link you gave. I just put my library above "libc.a" in the GUI for the option --library (MSP430 Linker -> File Search Path). I think the effect is the same.

    Thanks for the fast and precise answer!

  • Hi GregM,

    I'm using C and the #pragma directive. The vectors are defined in the lib.