Problem including Math.h to my project

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
golb
Posts: 8
Joined: Mon Nov 21, 2016 9:11 pm

Problem including Math.h to my project

Post by golb »

Hello again,

I am using a STM32F746 board with chibiOS 16.1.0 ( accordign to release notes on chibios folder in eclipse)

I am trying to include the math library to my project and I have read in various post that all i need to do is "#include <math.h>" in my code as I would do regularly, however when I add this to thecode i get an "unresolved include" the same issue that the people in the threads I've read ran into...

in these threads it was suggested that I put: -lm in the Makefile, on the field "ULIBS ="...I did this and I am still getting the error. I tried including the folder "C:\ChibiStudio\tools\GNU Tools ARM Embedded\4.9 2015q3\arm-none-eabi\include" as suggested on another thread but this also didnt help.

could any help me figure out this issue?
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: Problem including Math.h to my project

Post by Giovanni »

Hi,

It is working for me using the same compiler after putting

Code: Select all

ULIBS = -lm


in the Makefile, I tried the floor() function.

Are you sure your installation is complete? you could try unzipping ChibiStudio again.

Giovanni
golb
Posts: 8
Joined: Mon Nov 21, 2016 9:11 pm

Re: Problem including Math.h to my project

Post by golb »

thank you giovanni, I sorted it out by including the path to the folder where the library was.

I have seen other people run into the same problem so I wil make sure to write my solution with a lot of detail later today, as I am currently very busy, in case someone else runs into the same problem in the future.
golb
Posts: 8
Joined: Mon Nov 21, 2016 9:11 pm

Re: Problem including Math.h to my project

Post by golb »

Hello again,

I have run into some trouble again... after I included "math.h" succesfully to my project I started receiving the following error:

Code: Select all

'pow10' redeclared as different kind of symbol   chprintf.c   /Proyecto_Micro/os/hal/lib/streams   line 76   C/C++ Problem


could anyone help me sort this out?
Post Reply