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.

link error with undefined symbol divi

Other Parts Discussed in Thread: MSP430F1491

Hello

I am working on the MSP430f1491,and develop in C

In the algorithms, i perform some division and multiplicatio ( int and long, signed and unsigned) , like this example :

somvit = somvit - vitesse + dt_vit*18L; // 18L and NB_FILT are constant, somvit a long, vitesse a int

vitesse = somvit/NB_FILT;

The compilation is ok,

When I link, the C is traduced in asm, which find the instruction :

Severity and Description Path Resource Location Creation Time Id
errors encountered during linking; "TP1.out" not built  TP1_correction line 0 1378756691953 522
unresolved symbol __divli, first referenced in .....TP1_correction line 0 1378756691953 518
unresolved symbol __mpyi, first referenced in

unresolved symbol __mpyl, first referenced in

unresolved symbol I_LSR_4, first referenced in

so , build does not produce .out file

In the C file, i have included the math.h.

So , i would like what is wrong in the build property or other. What I have to verify in order to build correctly. I used the classical build option, the path to the libraries ( "${CG_TOOL_ROOT}/lib" )

 

Thanks for your help. In the other project, i have never had this error

Fabienne

  • __divli and __mpyi/l areinternal math funciton (divli == division long int). The compiler only generates  afunciton call in the compiled code and the linker normally should link these function from the runtime lib, like it does for the startup code.
    I have no idea why this doesn't happen.

    Since these function calls are toolchain-specific, I could imagine that such an error would appear if some of the object files were compiled by a different compiler and copied with the project (not recompiled since their source code didn't change). But in your case this doesn't seem to be likely. Anyway, try a project clean and then a fresh build.

  • Thanks for your answer Jean-Michel

    I have rebuild all the project and have always the errors

    I work with CCS V4. Before the project has been developped with IAR. I have add to make changes( definition, pragma, interrupt ...) and I still have these 2 errors.

     

  • Sorry, I can't help you then.
    I use MSPGCC, and have neither CCS nor IAR isntalled or ever used.If the compiler auto-generates these references, the linker should be able to resolve them.

    The only case would be if you are using (inline) assembly and use these functions to do math. Then these references cannot be resolved because the appropriate functions likely have a different name on CCS than on IAR.

    Maybe someone else has an idea.

  • I will try an other solution.

    the mpy function are already defined in the library and i  do not understand why the linker does not find it

    Thanks a lot

     

**Attention** This is a public forum