This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

could not open cmath.h + floorf and log10f

Hi folks

I am trying to use floorf and log10f functions

I see they are not available in math.h so Ive tried to include cmath.h instead

however the compiler issues the error "could not open source file "cmath.h""

I see the file available in the code generation tools\includes directory  in the project listing and have included the the file like so: "#include "cmath.h"

I have also tried with <> instead of "" with no change.

How should I correctly include this file?

Looking in the cmath.h I see that floorf()and log10f() are mentioned but in a different way to other functions under __SUNPRO_CC and with a "using" syntax.

Are these functions available by including this header? is there a better method to use?

Thanks

P.S. I am using CCS v4 with C2000 Piccolo ControlSTICK (F28027PT)

  • OK so I figured out my mistake Re the header file, should have been "cmath" not "cmath.h"

    However I still get an error relating to the floorf etc functions as: "unresolved symbol _floorf, first referenced in ./Project_name-Main.obj

    with the warning that the function is declared implicitly.

    So its basically still not taking notice of the mention of the function in cmath.....??? why is that?

    thanks

  • What version of the compiler are you using (not the CCS version).  You can find the complier version by running cl2000 from the command line with no arguments.

    Could you provide a test case that just calls floorf and which demonstrates the problem?