cancel
Showing results for 
Search instead for 
Did you mean: 

COMPILATION PROBLEM - "symbol multiply defined"

ebotsmith
Associate II

Posted on October 31, 2013 at 10:13

 

 

 

I am using STM8S 105C^Discovery with a Windows 8 Laptop. I tried to compile some example codes using Cosmic C Compiler with an Evaluation Key, but I got some errors.

 

 

Here is the message I got

 

=========================================================

 

 

 

----------- Project pwm - STM8 Cosmic - Configuration Debug -------------

 

 

 

Compiling fwlib\project\stm8s_it.c...

 

cxstm8 +mods0 +debug -pxp -no -pp -l -dSTM8S105 -ifwlib\project -ifwlib\library\inc -i''C:\Program Files\COSMIC\CXSTM8_EVAL\Hstm8''  -clDebug\ -coDebug\ fwlib\project\stm8s_it.c

 

fwlib\project\stm8s_it.c:

 

 

 

Compiling stm8_interrupt_vector.c...

 

cxstm8 +mods0 +debug -pxp -no -pp -l -dSTM8S105 -ifwlib\project -ifwlib\library\inc -i''C:\Program Files\COSMIC\CXSTM8_EVAL\Hstm8''  -clDebug\ -coDebug\ stm8_interrupt_vector.c

 

stm8_interrupt_vector.c:

 

 

 

Running Linker

 

clnk -m Debug\pwm.map -l''C:\Program Files\COSMIC\CXSTM8_EVAL\Lib''  -o Debug\pwm.sm8 Debug\pwm.lkf 

 

#error clnk Debug\pwm.lkf:71 Debug\stm8_interrupt_vector.o: symbol f_NonHandledInterrupt multiply defined (Debug\stm8s_it.o)

 

 The command: ''clnk -m Debug\pwm.map -l''C:\Program Files\COSMIC\CXSTM8_EVAL\Lib''  -o Debug\pwm.sm8 Debug\pwm.lkf '' has failed, the returned value is: 1

 

exit code=1.

 

 

 

pwm.elf - 3 error(s), 0 warning(s)

 

 

 

 

==============================================

 

 

I would appreciate if some one can advice me on how to solve this problem

4 REPLIES 4
Dmitriy Kozubenko
Associate II
Posted on May 31, 2017 at 22:18

Maybe you don't include some files like as stm8sxxx_it.c, 

stm8sxxx_it.h, stm8lxxx_conf.h

I had the same problem, but when I add this files in my project, the problem is gone.

Maksim Salau
Associate II
Posted on June 01, 2017 at 13:38

Hi,

The message says that you have NonHandledInterrupt defined in two files:

stm8_interrupt_vector.c and stm8s_it.c

Just remove one of them.

Maksim.

I have included all three files mentioned above, yet it didnt work at all.:frowning_face:

As @Maksim Salau said, the problem is that you've defined NonHandledInterrupt  in both stm8_interrupt_vector.c and stm8s_it.c

You need to remove one of those definitions.

 

PS

"Multiply defined" is just a clumsy & ugly way of saying that you have multiple definitions of NonHandledInterrupt 

PPS

Note that the message would be easier to read if posted using the </> button - as for source code:

 

=========================================================
----------- Project pwm - STM8 Cosmic - Configuration Debug -------------

Compiling fwlib\project\stm8s_it.c...

cxstm8 +mods0 +debug -pxp -no -pp -l -dSTM8S105 -ifwlib\project -ifwlib\library\inc -i''C:\Program Files\COSMIC\CXSTM8_EVAL\Hstm8''  -clDebug\ -coDebug\ fwlib\project\stm8s_it.c
fwlib\project\stm8s_it.c:

Compiling stm8_interrupt_vector.c...
cxstm8 +mods0 +debug -pxp -no -pp -l -dSTM8S105 -ifwlib\project -ifwlib\library\inc -i''C:\Program Files\COSMIC\CXSTM8_EVAL\Hstm8''  -clDebug\ -coDebug\ stm8_interrupt_vector.c
stm8_interrupt_vector.c:

Running Linker
clnk -m Debug\pwm.map -l''C:\Program Files\COSMIC\CXSTM8_EVAL\Lib''  -o Debug\pwm.sm8 Debug\pwm.lkf 

#error clnk Debug\pwm.lkf:71 Debug\stm8_interrupt_vector.o: symbol f_NonHandledInterrupt multiply defined (Debug\stm8s_it.o)

The command: ''clnk -m Debug\pwm.map -l''C:\Program Files\COSMIC\CXSTM8_EVAL\Lib''  -o Debug\pwm.sm8 Debug\pwm.lkf '' has failed, the returned value is: 1
exit code=1.

pwm.elf - 3 error(s), 0 warning(s)

==============================================