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.

TMS320F280040-Q1 - DCL library in a C++ Project: complex.h error

Other Parts Discussed in Thread: C2000WARE

Hello, 

I'm trying to use the DCL library in a C++ project and I'm facing the same problem as reported (https://e2e.ti.com/support/tools/code-composer-studio-group/ccs/f/code-composer-studio-forum/592407/compiler-c99-complex-in-c-mode-is-not-supported). Might the E2E community share more details of how to overcome this issue?

After I include the library header into the project ( #include "DCLF32.h") and added the library include to the path "C:\ti\c2000\C2000Ware_4_00_00_00\libraries\control\DCL\c28"

Description Resource Path Location Type
#35 #error directive: "C99 complex in C++ mode is not supported." .ccsproject /... line 35, external location: C:\ti\ccs1100\ccs\tools\compiler\ti-cgt-c2000_21.6.0.LTS\include\complex.h C/C++ Problem

#ifdef __cplusplus
# error "C99 complex in C++ mode is not supported."
#endif

Any help would be much appreciated.

Cheers,

  • Hi Luciano,

    I am working with software and compiler team to see if there is any permanent solution to this issue.

    In the mean time, since the complex library is only needed to allow complex pole / zeros to be supported in ZPK input mode on compensator parameter. If you are not making use of this mode, commenting out all the code related to DCL_ZPK3 (as well as the line that includes the complex.h file) should temporarily solve this issue for you and get your code compile and running. Let me know if this solution will work for you or if you have get any further questions. Thanks.

    Regards,

    Han

  • Hello Han,

    Thank you for your assistance. I followed your suggestion and the compilation errors have vanished. I just wanna add a complementary measure needed to be able to compile and integrate the DCL into a C++ project.

     
    After commenting  the #include <complex.h> in DCL32.h and in DCLF32.h I had to replace all #pragma instruction. The C syntax is different than C++ syntax what caused a "#821 badly formed pragma" error.

    The solution was to replace 

    #pragma CODE_SECTION(<Function Name>,"dclfuncs")

    by 

    #pragma CODE_SECTION("dclfuncs")

    just before each function.

    After this I was able to follow the DCL user's guide and complete the coding.

    Cheers