Page 1 of 1

Problem including Math.h to my project

Posted: Mon Dec 05, 2016 1:15 pm
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?

Re: Problem including Math.h to my project

Posted: Mon Dec 05, 2016 1:40 pm
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

Re: Problem including Math.h to my project

Posted: Mon Dec 05, 2016 4:28 pm
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.

Re: Problem including Math.h to my project

Posted: Fri Dec 09, 2016 1:31 am
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?