Marc Paquette

CodeWarrior 8- & 16-bit tools: Linker errors

Discussion created by Marc Paquette Employee on Jan 27, 2006
To help you find solutions to problems that have already been solved, we have posted this message. It contains an entire topic ported from a separate forum. The original message and all replies are in this single message.

Posted: Jul 26, 2004 - 06:06 AM   


I am working with CodeWarrior Development Studio for HC(S)08 Microcontrollers v3.0 special edition free license.

When I do a float multiplication seems there are undefined symbols in ansi.lib and I'll receive these messages :

'LINKER ERROR 1822: symbol _DUFLOAT ...'
'LINKER ERROR 1822: symbol _DMUL_RC ...'
'LINKER ERROR 1822: symbol _DSTRUNC ...'

/*this sentence provokes the error linker */
dummy=(unsigned int)((rad.volum*0.1)*0x7fff);

rad.volum is a unsigned char type

How can I solve this problem?.

thanks in advanced.


Posted: Jul 27, 2004 - 04:37 AM   


It looks like the ANSI library is not part of your project.
I would need to get access to the whole project to investigate that forward.


Posted: Jul 27, 2004 - 05:41 AM   


I don't discover how attach a file (my CW project) yet in this environment. Anyway if you use a wizard to make a new project choose MC68HC908SR12 chip and the followings settings as defaults, substitute the main code for this one:

//#define NUM_BY_FLOAT

#define INT_BY_FLOAT

void main(void)
unsigned int dummy;
unsigned char volum;
unsigned int value;

EnableInterrupts; /* enable interrupts */
/* include your code here */


/* this sentence work fine */
dummy=(unsigned int)((50*0.1)*0x7FFF);
/*this sentence provokes the error linker */
dummy=(unsigned int)((value*0.1)*0x7FFF);
/*this sentence provokes the error linker */
dummy=(unsigned int)((volum*0.1)*0x7FFF);

for(; {
__RESET_WATCHDOG(); /* kicks the dog */
} /* loop forever */

It seems that there are undefined symbols in the ANSI lib, it looks like the definitions exist but no the associate code function.


Posted: Jul 27, 2004 - 09:13 AM   


When creating the project with the wizard, did you specify you want to use floating point arithmetic?

This is the question asked on page 5.

If you are not sure, check which ansi library is inserted in the project. If you get ansii.lib or ansiti.lib, you have linked the library without floating point support.