This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Linking math library (C166 tool set, ST10F276), using uVision 4 IDE

Hi,

I am using the keil IDE uvision 4.0, If try to build the project with a file that uses math functions (i have included a reference to math.h), i get linker errors. I am using the IDE linker and not invoking from the command prompt, at first i thought that the IDE does not know where the C167FPS.LIB file is ? (C:\Keil\C166\lib), i checked the settings and they seem to be right, i am not sure if i need to manually specify the library to the linker ?, if so , how so i do not see a option in the project settings (i see, C166 locate, C166 misc) but no option to link to a library file. Could somebody point me in the right direction ?

Thanks for all the help,
Pavan.

  • i get linker errors. I am using the IDE linker and not invoking from the command prompt, at first i thought that the IDE does not know where the C167FPS.LIB file is ?

    which linker errors
    if you use the eval - is math.h part of the eval? floating point is not

    Erik

  • This is the following i get, and i am not using the eval version, i believe i have a regular (purchased) version of the product, I noticed MATH.h under the inc folder.

    linking...
    *** WARNING L7: MODULE NAME NOT UNIQUE MODULE: C:\KEIL\C166\LIB\C167FPS.LIB (LOG)
    *** ERROR L127: UNRESOLVED EXTERNAL SYMBOL SYMBOL: log MODULE: C:\KEIL\C166\LIB\C167FPS.LIB (POW)
    *** ERROR L128: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: log MODULE: C:\KEIL\C166\LIB\C167FPS.LIB (POW) ADDRESS: F140H

  • i believe i have a regular (purchased) version of the product
    how can you not KNOW
    what is the basis for your belief

    frst remove the warning, it may very well be the reason for the errors

  • It is not a eval version, you may be right about the warning, the help text says that
    "The specified module name is used for more than one module. The specified module name is not processed.", where i can change these settings ?

  • where i can change these settings ?

    It's rather doubtful that this depends on any "settings".

    The warning is about two modules (roughly translates to: *.obj files) in the link having the same name. One of those is in the math library --- so your earlier doubt about the math library not having been found was clearly unfounded. Now the question remains: where is the other module of the same name?

    Is there, by any chance, a sourcefile called "log.c" in your program? If so, you may want to rename that.

  • Great !, that solved the issue, i had file name log.c, however it is not clear to me as having a file name verbatim to a function in library was causing this issue ?, thanks for helping me out :)

  • as having a file name verbatim to a function in library was causing this issue ?

    That wasn't causing it. The conflict was between module names. For C files, those are, basically, the source filenames (without the .c).

    I.e. the C library has its implementation of standard library function log() in a file called, not altogether surprisingly, log.c. The module name of that is LOG (that's what the error message showed). The module name of your own source file log.c is also LOG. Thus the conflict.