error: 'fma' is not a member of 'std'

cancel
Showing results for 
Search instead for 
Did you mean: 

error: 'fma' is not a member of 'std'

204 Views
Contributor IV

Hi,

I am using S32 Design Studio toolchain for S32K based project.

I am seeing following error when I started using the toolchain with latest Design Studio v2.2 (GCC v6.3). But I haven't seen this issue with GCC 4.9 version that came with Design Studio v2018.R1.

math/interpolation.h:26:12: error: 'fma' is not a member of 'std'
return ::std::fma ( t, b, ( 1.0F - t ) * a );

Can someone please help in solving this issue with new toolchain?

Appreciated the quick turnaround.

Thanks,

Hari

Tags (3)
0 Kudos
8 Replies

43 Views
NXP Employee
NXP Employee

Make sure you have included math.h header in your file.

I've reproduced this error with newlib when there is no

#include <math.h>

pastedImage_2.png

Include resolves the issue.

0 Kudos

43 Views
NXP Employee
NXP Employee

Hi, 

it looks, that fma is not part of std for NewLib. With EWL library it is working okay:

pastedImage_1.png

Hope it helps. 

Jiri 

0 Kudos

43 Views
Contributor IV

Hello Jiri,

 

Could you also point me to the directory that you configured for $(S32DS_ARM32_EWL_DIR)?

 

I configured this path to the following:

--sysroot=$(TCHAIN_CFG_PATH)/S32DS/build_tools/gcc_v6.3/arm32_ewl2

 

But it gives me this error:

arm-none-eabi-gcc.exe: error: ewl_c9x_c++_noio.specs: No such file or directory

 

Thanks,

Hari

0 Kudos

43 Views
NXP Employee
NXP Employee

Hi, 

Actually - I just switched NewLib to EWL  as shown on screenshot above. I didn't modify any path/variable: 

pastedImage_1.png

Jiri

0 Kudos

43 Views
Contributor IV

It looks like I need both libraries (newlib and ewl).

Any suggestions how to add both libs to the make command?

Thanks,

Hari

0 Kudos

43 Views
NXP Employee
NXP Employee

Hi, 

Well, I'm not sure what's your goal. If you can modify your code with NewLib - you can just call fma(x,y,z). With ewl you can use std::fma. (actually - in my opinion - there is no difference). 

Why do you think that you need to mixed up two STD libs? 

Jiri

0 Kudos

43 Views
Contributor IV

Hi Jiri,

I don't want to use 2 std libs at the sametime.

But I am seeing this error if I am not using newlib.

cc1plus.exe: fatal error: lib_c++.prefix: No such file or directory

Do we have any other -specs to solve this error?

Thanks,

Hari

0 Kudos

43 Views
NXP Employee
NXP Employee

Hi, 

.prefix files for ewl are located (with default install path) in 

c:\NXP\S32DS_ARM_v2.2\S32DS\build_tools\gcc_v6.3\arm32_ewl2\EWL_C++\include\ 

folder. 

You probably modified some build variables. Normally you can choose C/C++ library from menu and that's it. S32DS sets all variables automatically for chosen C/C++ library. 

Here is similar thread - https://community.nxp.com/thread/455084  

Jiri

0 Kudos