undefined reference to `atof' with EWL_C

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

undefined reference to `atof' with EWL_C

2,149件の閲覧回数
patrice_couronn
Contributor I


I am currently developping an application on MPC5748G, using S32 Design Studio for Power Architecture, Version 1.0 build 151127. The project is compiled with GCC, using a make file.

My application uses the function "atof" from the EWL_C library. But unfortunatly, I get an error during the link:

undefined reference to `atof'

What needs to be done to make sure this function is linked correctly?

The EWL_C library source code contains the function but is it really compiled?

 

Thank you for your help.

ラベル(1)
タグ(2)
0 件の賞賛
返信
3 返答(返信)

1,879件の閲覧回数
martin_kovar
NXP Employee
NXP Employee

Hi,

try the following:

add file __strtold.c to your project (src folder). This file is placed in S32DS installation folder at path S32DS/e200_ewl2/EWL_C/src/stdio. Clean project and recompile.

I tested it with the following code and it seems that it returns correct result.

float val1;

char str1[20];

strcpy(str1, "98993489");

  val1 = atof(str1);

pastedImage_0.png

Regards,

Martin

0 件の賞賛
返信

1,879件の閲覧回数
patrice_couronn
Contributor I

Thank you for your help.

We finally solved the problem by updating S32 Design Studio to latest version V1.1 (build id: 160608)

Surely this version has an updated EWL_C library with the Atof function, because we don't have any link error anymore.

Thanks.

0 件の賞賛
返信

1,879件の閲覧回数
martin_kovar
NXP Employee
NXP Employee

Hi,

I had consulted this topic few minutes ago with one of our experts, and he confirmed me that S32DS v 1.1 is EWL_C library fixed and you are able to use atof function without any workarounds.

Regards,

Martin

0 件の賞賛
返信