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.

C6678 IQMath IQMath_inline_all.h compiler error - function _abs could not be resolved

Other Parts Discussed in Thread: TMS320C6678, SYSBIOS

Hi

CCSv5

C6000_cgt_7.4.15

C++

I've added the IQMath 2.1.4.0 library to my C++ C6678 folders and added the folder to the include path.

I've added the pre-processor define _INLINE_IQMATH

And this is how I've include the header files

#ifdef _INLINE_IQMATH
#include "IQmath_inline_all.h"
#else
#include "IQmath.h"
#endif

I get a ton of _abs errors and others. Basically any intrinsic in the IQMath_inline_all.h file.

Description Resource Path Location Type
Function '_abs' could not be resolved IQmath_inline_all.h /C6678_SeperateCfgPrj/IQMath_2_1_4_0/include line 697 Semantic ErrorFunction '_hill' could not be resolved IQmath_inline_all.h /C6678_SeperateCfgPrj/IQMath_2_1_4_0/include line 1094 Semantic Error

Any thoughts on how to fix the compiler errors?

Cheers2u

Eddie

  • Hi Eddie,
    Where did you download the IOMath library for C66x DSP ?

    Can you please give the procedure to reproduce this build issue ?

    Which example are you trying to build ?
  • Hi

    Unfortunately, I cannot find a IQMath library for the C66x? There is nothing listed here

    http://www.ti.com/product/TMS320C6678/toolssoftware

    The fellow below uses the C64x library for the C6678
    e2e.ti.com/.../272626

    and I can only find the C64x library on the wiki
    processors.wiki.ti.com/.../C64x_IQmath

    Proceedure
    1) Create example SYSBIOS project (seperate configuration)
    2) Change files to main.c to main.cpp
    3) copy the IQMath .h, and .c files to project (this is the IQMath source code thats required since I'm using inline code). 
    4) Rename the IQMath tables .c file to .cpp
    5) Include the path to the IQMath header files

    6) add the includes below to the main.cpp file

    #ifdef _INLINE_IQMATH
    #include "IQmath_inline_all.h"
    #else
    #include "IQmath.h"
    #endif

    7) Define _INLINE_IQMATH in the pre-processor defines

    8) Add the typedef.h file from the non-IQMath include directory (I've not idea why they didn't include this in the IQMath source code)

    9) In the IQMath_inline_all.h file, add the following 

    #if 1
    	#warn "Eddie Changed const to #define because of compiler error: expected at ;"
    	#define c1 ((I32_IQ)(0xffffffff))
    	#define c2 ((I64_IQ)(0xffffffff80000000))
    	#define c3 ((I64_IQ)(0x7fffffff))
    	#define c4 ((I32_IQ)(0x80000000))
    	#define c5 ((0xffffffff))
    	#define c6 ((0x80000000))
    #else
    // This causes a compiler error const I32_IQ c1 ((I32_IQ)(0xffffffff)) const I64_IQ c2 ((I64_IQ)(0xffffffff80000000)) const I64_IQ c3 ((I64_IQ)(0x7fffffff)) const I32_IQ c4 ((I32_IQ)(0x80000000)) const unsigned int c5 ((0xffffffff)) const unsigned int c6 ((0x80000000)) #endif

    10) Change the code in the IQMath tables file

    #if 1
    #warn "Eddie had to remove const to get this to compile"
        I32_IQ IQdivTable[]={
    #else
    	const I32_IQ IQdivTable[]={
    #endif

    11) Add an IQ math example to the main.cpp

    Void IQMathExample()
    {
    #define X 2.6f
    #define Y 8.4f
    
        I32_IQ x = _IQ24(X);
        I32_IQ y = _IQ24(Y);
        I32_IQ z;
        float Z;
    
        z = _IQNdiv(x, y, Q24);
    
        Z = _IQNtoF(z, Q24);
    
        System_printf("%f (%d) divided by %f (%d) equals %f (%d) \n",
                X, x, Y, y, Z);
    
        System_flush(); /* force SysMin output to console */
    
    }

    12) build it - this is where you get the "Function '_abs' could not be resolved..." errors (with CCSv5 but not with CCSv6)

    Cheers
    Eddie

  • Hi

    I created a CCSv6 project and for some reason, it does not give the same error (project attached). Why it doesn't compile in CCSv5 is odd.

    There are some changes I had to make to the IQMath library to work (see previous post or attached project). Search the code for "Eddie" or look at the compiler warnings.

    If you could write a ticket for the IQMath library changes I had to make (or tell me how to not get the compile errors without the changes I made to IQMath_inline_all.h and IQMathTables.cpp), I will mark this question as answered. 

    Cheers

    Eddie

    CCSv6_C6678_sysbiosTypical_IQMath1.7z

  • Edie

    This is really a compiler issue. Can you please open a new thread in e2e.ti.com/.../compiler and link it to this posting?

    Ran
  • Hi Ran
    Thanks for pointing me to the right forum.
    Here is the post for those who find this thread
    e2e.ti.com/.../474840

    Cheers
    Eddie
  • Hi Ran
    Thanks for pointing me to the correct forum. Here is the link to this thread in the compiler forum.
    e2e.ti.com/.../474840

    Cheers
    Eddie