Linker error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Linker error

8,335 Views
NT
Contributor I
I am new to Freescale Codewarrior. I am getting following errors.
 
Link Error : Undefined : "_d_div"
Link Error : Undefined : "_d_dtoi"
Link Error : Undefined : "_d_fgt"
Link Error : Undefined : "_d_mul"
Link Error : Undefined : "_d_utod"
Link Error : Undefined : "_f_ftod"
Link Error : Undefined : "_f_itof"
Link Error : Undefined : "_f_mul"
 
 
Can anyone help me solve this problem.
 
Thanks,
NT
Labels (1)
0 Kudos
25 Replies

1,591 Views
polofermin
Contributor III

Hello, someone have this problem??:

 

Link Error   : Undefined : "_d_fle"
Referenced from "IRQ_ADE_ISR" in main.c

Link Error   : Undefined : "_d_itod"
Referenced from "IRQ_ADE_ISR" in main.c

Link Error   : Undefined : "_d_utod"
Referenced from "IRQ_ADE_ISR" in main.c

Link failed.

 

Thanks so much!

Regards

0 Kudos

1,591 Views
kef
Specialist I

_d_fle - is a double precision floating point compare routine. le in routine name stands for less or equal.

_d_itod - convert signed integer :smileyinfo: to double routine

_d_utod - convert unsigned integer (u) to double routine

 

Like suggested before, you have these options:

1) create new project and tell project wizard you want floating point.

2) add to the project required libraries

3) in your IRQ_ADE_ISR avoid using floating point.

0 Kudos

1,591 Views
polofermin
Contributor III

Well, thank you so much Kef. I want to do the third option, how avoid using floating point in my IRQ_ADE_ISR routine?. It is the first time that I work with interrupt, thanks again,

 

Best regards!!

0 Kudos

1,591 Views
kef
Specialist I

If you aren't using any float or double variables, any function from <math.h>, then maybe show your IRQ_ADE_ISR and all IRQ_ADE_ISR referenced variables.

0 Kudos

1,591 Views
polofermin
Contributor III

This file, main.c, haven´t compilation error...but I don´t know do that you say me...because yet I am inexpert in this matter

Thank

regards

0 Kudos

1,591 Views
polofermin
Contributor III

Ok, I enclose my file.c where I define main() routine and ISR routine.

Thanks

 

main.c

Message Edited by t.dowe on 2009-12-02 11:12 AM
0 Kudos

1,591 Views
kef
Specialist I

You have lines like this: 

 

   if (1.1*Icorte<=get_corriente_IRMS()<=1.4*Icorte)

 

1) 1.1 and 1.4 are floating point numbers. To avoid FP arithmetics, you could multiply all arguments by 10. a<b<c is the same like 10a<10b<10c.

 

2) In C   a < b < c is not the same like a < b < c in math. First a is compared to b giving logical answer true (not zero) or false (zero). Then result of a<b is compared against c. I guess this is not what you want.

 

Hope this is what you want:

   if ( (11*Icorte <= get_corriente_IRMS()*10) && (get_corriente_IRMS()*10<=14*Icorte) )

 

 

You should make sure get_corriente_IRMS()*10 doesn't overflow, else it may not work this way.

 

You may fix other other occurences of 1.1 and 1.4 the same way.

0 Kudos

1,591 Views
polofermin
Contributor III

Hello again!, I have solved all problems with linker... but now, when I simulate my program goes to exceptions.c....Two days ago, I enclosed my file main.c, where I define interrupt routine within this c file, but is it correct?..maybe I must define this interrupt routine out of c file...

 

Best regards

 

Thanks!!

 

0 Kudos

1,591 Views
J2MEJediMaster
Specialist I

Speaking generally, the exceptions.c file is where you specify the address of your ISR routine. In other words, this file defines the interrupt vector table for the ISRs. When an exception occurs, it first jumps to the vector table, then picks up the address of the ISR to jump to. Have you specified the name of your ISR in the appropriate location in the exceptions.c file? You might want to take a look at the CodeWarrior sample code. Usually an example of a simple interrupt routine is provided, to guide you on setting one up.

 

---Tom

Message Edited by J2MEJediMaster on 2009-12-02 09:25 AM
0 Kudos

1,591 Views
polofermin
Contributor III

Hello,

I am new in CodeWarrior:

-I am targeting with MCF51EM256 CPU

-My version of CodeWarrior is: Codewarrior IDE version 5.9.0 Build 2830

I´m programming with FreeRTOS kernel and I use IRQ interrupt. I don´t have any problem with linker, but when I simulate the program entry for once in the IRQ interrupts and it doesn´t entry again.

any idea?

Thanks so much..

Best regards 

 

0 Kudos

1,591 Views
RickN
Contributor I
Hi,
 
   You need to identify the version of CodeWarrior that you are using.  
 
     - Thanks
 
   Rick
0 Kudos

1,591 Views
NT
Contributor I
Rick,
 
I am using Codewarrior IDE version 5.7.0. Build 2015
 
Thanks,
NT
0 Kudos

1,591 Views
CompilerGuru
NXP Employee
NXP Employee
Thanks for trying :smileyhappy:

Unfortunately "Codewarrior IDE version 5.7.0. Build 2015" refers to the ide, the editor and build system, so it does not really specify what you are targeting.
Which core (e.g. Coldfire, ....), which derivative (...), which product version are you using?

And what did you actually start with? Given the names of the missing functions you apear to link a non floating point library while using the floating point runtime support.

Daniel

See also
http://forums.freescale.com/freescale/board/message?board.id=CWCOMM&message.id=3819
0 Kudos

1,591 Views
J2MEJediMaster
Specialist I
This posting moved to a more suitable location.
0 Kudos

1,591 Views
polofermin
Contributor III

Hello I am new in CodeWarrior:

-I am targeting with MCF51EM256 CPU

-My version of CodeWarrior is: Codewarrior IDE version 5.9.0 Build 2830

 

I am programming with this CPU and I use vector interrupts (IRQ, vector number 64, no maskarable). I have defined within of my program (but out of routine main()) the ISR of IRQ. I compile with succes but I have any problems with the linker:

 

Link Error   : Undefined : "_d_fle"
Referenced from "IRQ_ADE_ISR" in main.c

Link Error   : Undefined : "_d_itod"
Referenced from "IRQ_ADE_ISR" in main.c

Link Error   : Undefined : "_d_utod"
Referenced from "IRQ_ADE_ISR" in main.c

Link failed.

 

What it is happens?, thanks!!

Best regards.

 

Message Edited by polofermin on 2009-11-26 11:08 AM
0 Kudos

1,591 Views
Lundin
Senior Contributor IV
As Kef said, you are most likely linking towards the wrong compiler library. If you want to use float numbers in your program, you must select float numbers when you create the project in the project wizard.

Create a new project and select float numbers instead of integer only.
0 Kudos

1,591 Views
polofermin
Contributor III

Thank you for your reply Lundin, but I think that my problem is in the use of IRQ interrupt, I have defined it within of my program but out of main() routine, that is correct?.

If you want see I can enclose my file.c

Thaks!!

Best regards!

0 Kudos

1,591 Views
NWARROW
Contributor I

Hi 

 

I am also facing same problem

I am targeting  MCF52259 ColdFire. CW is giving me _d_mul and other linker errors.

 

Regards,

NW 

0 Kudos

1,591 Views
stanish
NXP Employee
NXP Employee

Hello,

 

There are two different products for ColdFire target Freescale offers:

1) CodeWarrior for MCUs - supports  HC(s)08 + CFv1 only   

2) CodeWarrior for ColdFire - supports CFv2...v4

  

I'm little confused here:

The target you mentioned refers to 2) but Product name in the subject refers to option 1)

You've probably mismatched both versions. e.g. open and compile project created in 2) in CodeWarrior 1).... 

Since you are targeting MCF52259 you should use CodeWarrior for ColdFire. The latest version is available here.

 

Stanish 

 

Message Edited by stanish on 2009-10-20 10:17 AM
0 Kudos

1,591 Views
NWARROW
Contributor I

HI,

 

Thanks for reply.

I have downloaded new Version and now i am trying to build with CW :Coldfire Architectures Version 7.1, Build 14.

 

I am getting same linking errors .I am aslo getng one warning "too manycommand files" 

 please help.

 

Regards,

NW 

 

0 Kudos