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.

Compiler: ffs function not available for C++?

Other Parts Discussed in Thread: TMS320F28054M

Tool/software: TI C/C++ Compiler

I'm developing a bare-metal C++ program for Texas Instruments' TMS320F28054M MCU, and am building my project with the TMS320C2000 C/C++ Compiler v20.2.2.LTS. I noticed that even if I #include the nonstandard <strings.h> header, the ffs function is still not found and I get a linker error. This doesn't happen when building from a C file. Am I doing something wrong?

  • Thank you for reporting the problem.  I can reproduce the same behavior. I filed the entry EXT_EP-10039 to have this investigated.  You are welcome to follow it with the link below in my signature.

    Please consider this workaround.  Add these lines ...

    extern "C" {            // add this line
    #include <strings.h>
    }                       // and this line

    This fixes the problem in the small test case I used to reproduce the problem.  I am confident it will work in most cases.  But that has not been fully tested.

    Thanks and regards,

    -George

  • Thanks for the response. IIRC that was the first thing I tried, but didn't work either. I'll give it another shot, though; maybe I had made a mistake.