Build library question

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

Build library question

Jump to solution
2,365 Views
geoffW
Contributor III

Hi

 

I am pretty sure the build library default for Code Warrior V7.1 means that printf doesnt support floating point numbers

 

I am assuming I need to change a library setting somewhere to support floats, but cant find the docs for it.

 

I can only find the instruction for V7.2 which is different (I dont have the settings in the build gui panel )

 

Thanks for any tips

 

Geoff

Labels (1)
0 Kudos
Reply
1 Solution
976 Views
geoffW
Contributor III

Thanks for the help guys

 

The penny eventually dropped as to what I was doing wrong.

 

I was linking with MQX, but had forgotten MQX hijacks the printf() function, so it was not even using the C standard library one. To enable floating point I should have enabled the floating point macro in the MQX user config header file.

 

Regards Geoff

View solution in original post

0 Kudos
Reply
6 Replies
976 Views
CrasyCat
Specialist III

Hello

 

Well if you want the Tech Support guy to look into this I would recommend you to submit a service request for that.

Click here to submit a service request.

Make sure to attach a reproducible project and installed product information to the service request.
To generate the required information:
- Start CodeWarrior
- Open the project
- Select "Help" -> "Pack and Go" and follow instructions on the screen.

Attach the generated .zip file to the SR.

 

CrasyCat

0 Kudos
Reply
976 Views
geoffW
Contributor III

Hi

 

I thought I had figured this problem out, but my solution didnt work.

 

The default library my code was linking against was C_4i_CF_RegABI_MSL.a   (plus a couple of others that prob not relevant to this issue)

 

I disabled that library and added C_4i_CF_FPU_RegABI_MSL.a instead

 

Unfortunately this didnt fix it, my printf("%f", myfloat) still prints out "f"

 

I had assumed the FPU in this filename means enable float support in printf.  Of course I could be wrong it could be a library for a Coldfire with floating support FPU hardware or something ?

 

Any ideas what I am doing wrong please ?

 

Why on earth  couldnt they add a checkbox on the linker page to say "Enable floating point in Printf"  ? It would be so much easier.

 

Geoff

 

 

 

 

 

 

0 Kudos
Reply
976 Views
J2MEJediMaster
Specialist I

See if the suggestions in this https://community.freescale.com/message/16187#16187 can help you. Also, you can try searching the forums (use the search box at the upper right of this page) using the phrases "print" and "float" to display a number of threads with similar information.

 

---Tom

0 Kudos
Reply
976 Views
geoffW
Contributor III

Hi

 

I already read the manual, and searched the forum and read the thread.

 

Thats how I came up with FPU library filename to  link against. So I was fairly confident it would fix the problem.

Alas it didnt, so still scratching my head on this one.

 

This really should be an easy one for the Tech Support guys, as it must be a fairly common question.

 

Regards Geoff

0 Kudos
Reply
976 Views
J2MEJediMaster
Specialist I

What library are you linking into the project?

 

---Tom

0 Kudos
Reply
977 Views
geoffW
Contributor III

Thanks for the help guys

 

The penny eventually dropped as to what I was doing wrong.

 

I was linking with MQX, but had forgotten MQX hijacks the printf() function, so it was not even using the C standard library one. To enable floating point I should have enabled the floating point macro in the MQX user config header file.

 

Regards Geoff

0 Kudos
Reply