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 Warning

Other Parts Discussed in Thread: CCSTUDIO

I am using the IQmath library and using the IQmath_inline.h header to enable inlining for certain IQMath APIs. When I compile my project I get the following warning:

"C:/CCStudio_v3.3/c64plus/IQmath_v212/include/IQmath_inline.h", line 1069: warning: external/internal linkage conflict with previous declaration"

It looks like I am getting this warning for every single IQmath function call. Does anyone know why I am getting this warning? I can't seem to find where the IQmath functions would have been previously declared. Thanks

  • Are you trying to compile one of the examples that come with IQmath or is it you own project?

    Make sure that in your source file you have:

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

    Also, you need to have the symbol _INLINE_IQMATH. You can do that by right clicking in your project, selecting Build Options..., At the Compiler tab, Category Preprocessor, put the symbol _INLINE_IQMATH in the Pre-Defined Symbol field.

  • I am compiling my own project that make use of IQmath. Note that I am including the "IQmath_inline.h" only once in a header file in my project. The header file is called through out the projects. In addition, for some reason the compiler wouldn't pick up the IQmath_inline.h unless I include the full path to the header ( ie #include "C:/CCStudio_v3.3/c64plus/IQmath_v212/include/IQmath_inline.h").

    When I was getting the compiler warning I did not define the _INLINE_IQMATH symbol.

    However when I include the _INLINE_IQMATH symbol as suggested in the previous post I don't get the compiler warning but I now get the errors below. I did implement the #ifdef _INLINE_IQMATH code segment as well.

    "C:\CCStudio_v3.3\c64plus\IQmath_v212\include\IQmath.h", line 1205: error: function "_IQNdiv" was referenced but not defined
    "C:\CCStudio_v3.3\c64plus\IQmath_v212\include\IQmath.h", line 1745: error: function "_IQNsin" was referenced but not defined
    "C:\CCStudio_v3.3\c64plus\IQmath_v212\include\IQmath.h", line 2271: error: function "_IQNcos" was referenced but not defined
    "C:\CCStudio_v3.3\c64plus\IQmath_v212\include\IQmath.h", line 2874: error: function "_IQNsqrt" was referenced but not defined
    "C:\CCStudio_v3.3\c64plus\IQmath_v212\include\IQmath.h", line 1473: error: function "_IQNlog" was referenced but not defined

     

  • You need to also include the path to the IQmath include directory into the compiler options with the -I<path to dir> option.

    This will allow the compiler to add the directory path to its search to find the IQmath_inline.h and IQmath.h files.  You can then remove the absolute path in your source code.

  • Thanks for the instruction on eliminating absolute path in my source code Brandon. However, I am still getting either the compiler warning or compiler errors as described in my previous posts.

  • Are these errors occuring during the Linking stage?

    If so, you need to include a similar path to the library as you did for the include files.  You will also need to include the library into your project.

  • I am getting the errors during the compilation of the source code. Below is an example of the failure and where the errors are occuring.

    ------------------------------  myproject.pjt - Debug  ------------------------------
    [abc.c] "C:\CCStudio_v3.3\C6000\cgtools\bin\cl6x" -g -k -s -pdsw225 -al -fr"C:/CCStudio_v3.3/abc/src/matlab_benchmark/dsp/myproject/Debug" -i"C:/CCStudio_v3.3/c64plus/IQmath_v212/include" -d"benchmarks_debug" -d"_INLINE_IQMATH" -mw -mv6400+ --consultant -@"../../myproject/Debug.lkf" "abc.c"
    "C:\CCStudio_v3.3\c64plus\IQmath_v212\include\IQmath.h", line 1205: error: function "_IQNdiv" was referenced but not defined
    "C:\CCStudio_v3.3\c64plus\IQmath_v212\include\IQmath.h", line 1745: error: function "_IQNsin" was referenced but not defined
    "C:\CCStudio_v3.3\c64plus\IQmath_v212\include\IQmath.h", line 2271: error: function "_IQNcos" was referenced but not defined
    "C:\CCStudio_v3.3\c64plus\IQmath_v212\include\IQmath.h", line 2874: error: function "_IQNsqrt" was referenced but not defined
    "abc.c", line 8: warning: function "printInfo" was declared but never referenced
    4 errors detected in the compilation of "abc.c".

     

  • Hello, I am sorry for your trouble. Please let me explain what is going on. As you know the IQMath lib supports inlining for the functions. The IQMath.h header file includes definitions like:

    #ifdef _INLINE_IQMATH
    static inline I32_IQ _IQNsqrt(I32_IQ x, U32_IQ qfmt);
    #else
    I32_IQ _IQNsqrt(I32_IQ x, U32_IQ qfmt);
    #endif

    to support inlining. The user is required to define _INLINE_IQMATH and include IQmath_inline.h in the source files. The IQmath_inline.h further includes IQMath.h and also provides the source for the kernels to enable inlining.

    Now, even though all the functions can be inlined, due to IP reasons, not all the functions are included in source in the IQmath_inline.h file that is made available for open download. This is highlighted in the release ReadMe.txt 

    "This release provides support for inlining of the below functions:
    FtoIQ.c, IQNabs.c, IQNfrac.c, IQNint.c, IQNmag.c, IQNmpy.c, IQNmpyI32frac.c, IQNmpyI32int.c, IQNmpyIQx.c, IQNrmpy.c, IQNrsmpy.c, IQNsat.c, IQNtoF.c
    The inlining support can be enabled by including the IQmath_inline.h file."

    NOTE, customers can get access to the entire lib in source by having a simple NDA.

    The functions that are not provided in source will give error if tried to inline. The recommendation is that the customer doesn't mix and math the inline and lib usage of kernels. BUT that is not very practical. So I agree the current IQMath release needs to be updated to provide a better solution to the problem. Below is what we will do:
    1. Please work with your TI contact to receive the entire source for the IQMath lib. This will be useful if you indeed want to inline some of the kernels not provided in source today.
    2. Attached updated IQMath.h (renema from IQMath.h.txt) that you can use. (I have made quick mods which I believe should be OK, but I have not verified). The attached header file should avoid the issue that you are seeing
    3. We will make updates in the future IQMath release so that such issue is not observed

    Regards,
    Gagan