2013-10-31 02:13 AM - last edited on 2024-07-09 02:11 AM by Andrew Neil
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
2017-05-31 01:18 PM
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.
2017-06-01 04:38 AM
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.
2024-07-09 02:03 AM
2024-07-09 02:10 AM - edited 2024-07-09 02:15 AM
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)
==============================================