cancel
Showing results for 
Search instead for 
Did you mean: 

Linker problem ''symbol d_imul not defined''

ericstark9
Associate
Posted on November 04, 2011 at 01:51

I'm building a project for an STM8S208 using the Cosmic compiler (CXSTM8_32K) within ST Visual Develop.  When I link, I receive the error ''symbol d_imul not defined''.  The project was working well previously using only 8-bit operations, but I recently added some 16-bit multiplication operations.  Do I need to link in an additional math lib to support 16-bit (or 32-bit, for future reference) operations?

#stm8s-stm8s208-cosmic-stvd #stm8 #cosmic #math.h
4 REPLIES 4
luca239955_stm1_st
Senior II
Posted on November 04, 2011 at 11:46

Hi,

the general rule, as you have guessed, is that the most complex math you need, the more libraries you need to link: see page 280 of the user manual for more details.

However, for your specific case, imul is part of the basic libm library, which is always linked, so your problem probably comes from the fact that you are linking code AFTER the libraries (with STVD this can happen, for example, if you write code in the file that contains the interrupt vectors).

Regards

Luca (Cosmic)

ericstark9
Associate
Posted on November 04, 2011 at 14:27

Your suspicion is correct - I had moved the interrupt vector table into a file with code... a lot of code.  This is unexpected behavior, but who works with embedded tools and doesn't come across at least three unexpected things before lunch daily.  I'll move the table out and give it another go.  Thanks for your assistance!

giu
Associate II
Posted on November 30, 2011 at 15:42

In my case the linker shows the same error with math.h library. I included it in main.c ( #include <math.h> ) but I get ''symbol _sqrt not defined (Debug\main.o )'' (I need sqrt function in my code)

(Cosmic compiler CXSTM8_32K)

I am using ST Visual Develop.

Please help
giu
Associate II
Posted on December 01, 2011 at 12:59

The problem is solved by simply enabling the float libraries in the STVD linker (clink) options