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.

How to prevent nulti_include “IQmathLib.h”?



In my project using F2808,there are two documents need use iqmath,so I include the IQmathLib.h: in the two documents,such as:

 

A.c

#include "IQmathLib.h"

…..

B.c

#include "IQmathLib.h"

 

But when “rebuld all”,The ccs3.1 display “warning: typedef name has already been declared (with same type)” two times.

 

1,What should I do?Ple teach me in detail .

2, In the IQmathLib.h ,why didn’t protect itself use ‘ifndef_define’ to prevent nulti_include it?

  • If you take a look at IQmath.h it does indeed have multiple include guards:

    #ifndef __IQMATHLIB_H_INCLUDED__
    #define __IQMATHLIB_H_INCLUDED__

    ....

    ....

    #endif /* __IQMATHLIB_H_INCLUDED__ */

     

    Could it be something else in the project causing the multiple typedef defines?

    Regards

    Lori

  • Hi.

    Where they are?I cann’t find them.The first part of  IQmathLib.h as bellow.

    Regards

    Xufeihx

     

     

    //###########################################################################

    //

    // FILE:   IQmathLib.h

    //

    // TITLE: IQ Math library functions definitions.

    //

    //###########################################################################

    //

    // Ver  | dd-mmm-yyyy |  Who  | Description of changes

    // =====|=============|=======|==============================================

    //  1.3 | 19 Nov 2001 | A. T. | Original Release.

    // -----|-------------|-------|----------------------------------------------

    //  1.4 | 17 May 2002 | A. T. | Added new functions and support for

    //      |             |       | intrinsics IQmpy, IQxmpy, IQsat.

    // -----|-------------|-------|----------------------------------------------

    //  1.4a| 12 Jun 2002 | A. T. | Fixed problem with _IQ() operation on

    //      |             |       | variables.

    // -----|-------------|-------|----------------------------------------------

    //  1.4b| 18 Jun 2002 | A. T. | Fixed bug with _IQtoIQN() and _IQNtoIQ()

    //      |             |       | operations.

    // -----|-------------|-------|----------------------------------------------

    //      |             |       |

    //

    //###########################################################################

    //

    // User needs to configure "MATH_TYPE" and "GLOBAL_Q" values:

    //

    //---------------------------------------------------------------------------

    // Select math type, IQ_MATH or FLOAT_MATH:

    //

    #define   FLOAT_MATH     1

    #define   IQ_MATH        0

     

    #ifndef   MATH_TYPE

    #define   MATH_TYPE      IQ_MATH

    #endif

     

    //---------------------------------------------------------------------------

    // Select global Q value and scaling. The Q value is limited to the

    // following range for all functions:

    //

    //        30 <= GLOBAL_Q <=  1

    //

    #ifndef   GLOBAL_Q

    #define   GLOBAL_Q       24

    #endif

     

    //---------------------------------------------------------------------------

    // Various Usefull Constant Definitions:

    //

    #define   QG          GLOBAL_Q

    #define   Q30         30

    …………

     

     

  • Appears they were added as of version 1.4d.  The latest version is 1.5a.

    Regards

    Lori

  • Most of the PMSM libraries have 1.4b as the latest. Where do I download 1.5a? Is it safe to replace the old file with the new one?

    Thanks.

  • It is available on TI's website at this URL: 

    http://focus.ti.com/docs/toolsw/folders/print/sprc087.html

    Regards,

    -Lori