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.

Missing symbols in mathlib 3.1.0.0

Other Parts Discussed in Thread: MATHLIB

Hi

I have recently tried to create a project where I use mathlib version 3.1.0.0. However when I build the project it fails when linking. It looks like the mathlib.ae66 library is missing symbol that it needs in order to link propperly. This is the error message:

...
'Building target: UseMathlib.out'
'Invoking: C6000 Linker'
"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/cl6x" --abi=eabi -g --display_error_number --diag_warning=225 --diag_wrap=off -z -m"UseMathlib.map" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/lib" -i"C:/ti/ccsv5/tools/compiler/c6000_7.4.2/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="UseMathlib_linkInfo.xml" --rom_model -o "UseMathlib.out" -l"./configPkg/linker.cmd"  "./main.obj" -l"libc.a" -l"C:/ti/mathlib_c66x_3_1_0_0/packages/ti/mathlib/lib/mathlib.ae66"
<Linking>

 undefined first referenced
  symbol       in file     
 --------- ----------------
 logtable  ./main.obj      

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "UseMathlib.out" not built


When browsing the mathlib source code i can find the source code that defines logtable in the src/common/tables.c file. However using the nm6x and ar6x tool I can verify that this source code is not a part of the mathlib.ae66 file.

Is it by intention that the content of src/common/tables.c is missing from the mathlib.ae66 file?

Here is a small example project that reproduces the linker error:
8311.4760.UseMathlib.tar.gz

  • Kjetil,

    I have moved this thread over to the device forum in hopes that someone knowledgeable about mathlib will be able to respond there.

  • Hi David,

    Thanks, hopefully someone at the mathlib team will pick this up.

    Do you know where I can file bugs to the mathlib project? In the 3.1.0.0 version it no longer works to include the header file ti/mathlib/mathlib.h because of multiple definitions of the pol_est_asindp_i function.

  • Hi Kjetil,

    I downloaded your project. In CCS using mathlib 3.1.0.0 I get the "multiple definitions" error but not the unresolved symbols error. Are you seeing both of these errors when using 3.1.0.0?

    I'm working to address the multiple definitions error currently.

    Thanks,

    Ian

  • Hi Ian,

    It's great that you're working on the multiple definitions error.

    I see both these errors when using mathlib version 3.1.0.0. It is interresting that you are able to link with 3.1.0.0. Can you post your output .map file so I can see where your application is getting the logtable symbol from? Can you also post the output of running the nm6x tool on the mathlib binary that you are linking with?

    My output of nm6x looks like this:

    /opt/ti/ccsv5/tools/compiler/c6000_7.4.2/bin/nm6x mathlib.ae66 | grep logtable
    00000000 U logtable
    00000000 U logtable
    ...

    Which basically says that the logtable is undefined in the mathlib.ae66 binary.

  • Hi Kjetil,

    Actually, I reimported your project fresh and checked the RTSC settings under Project->Properties->General-> RTSC Tab, and Mathlib 3.0.2.0 is selected. Are you sure you have 3.1.0.0 selected?

    When I build with 3.0.2.0 I see the unresolved symbols error, and if I change the RTSC settings to use 3.1.0.0, I no longer see this error, but I see the multiple definitions error instead. However, I can't get both errors to appear simultaneously. Can you confirm which version you have selected please?

    Could you also please tell me which device specifically you are working with?

    Thanks,

    Ian

  • Kjetil,

    Using 3.1.0.0, I resolved the multiple definitions error. The function pol_est_asindp_i() is defined both in atandp_i.h and asindp_i.h which was causing the issue. I will check whether this is an error by the mathlib team.

    I was able to resolve by simply including <ti/mathlib/src/log10sp/log10sp.h> instead of the entire mathlib.h header file. You can also just comment out atandp.h from the mathlib.h file as well. This is a simple resolution until we figure out why this function is included in two separate function headers.

     

    However, now that that is resolved, I see the logtable unresolved symbol issue again (using 3.1.0.0), so I will continue investigating that.

     

    -Ian

  • Hi Ian

    Here is an updated version of the project using 3.1.0.0 and getting the linker error. 3531.LinkError.tar.gz

    Like you said I had to include <ti/mathlib/src/log10sp/log10sp.h>. This header error and linker error makes me wonder if anyone else is using the mathlib?

  • Hi Kjetil,

    First, I chose to simply comment out "#include <ti/mathlib/src/atandp/atandp.h>" from mathlib.h, and include mathlib.h in my project like you had originally.

    To resolve the "unresolved symbols" error, please add the following line to mathlib.h:

    #include <ti/mathlib/src/common/tables.c>

    tables.c contains the definition for logtable[] which is what the unresolved symbol is.

     

    After this, you will get a linking error that CCS cannot find "mathlib.ae66". To resolve this, open Project->Properties->Build->C6000 Linker->File Search Path, and delete the line:

    "${TI_MATHLIB_C66X_INSTALL_DIR}/lib/mathlib.ae66"

    The directory changed a bit from mathlib 3.0.x.x to 3.1.x.x and this library file is not located there anymore. However, you shouldn't need it to build this project, so just delete the line.

    After this I was able to build succesfully. Please let me know if you have further errors.

    Thanks,

    Ian

  • Hi Ian,

    Thanks for the help, now I'm able to build succesfully too. I hope the mathlib team will create a new version where both the header and linking issues are resolved in a better way.

    I will upload the latest version of the project so anyone facing the same issues can take a look.  6278.Workaround.tar.gz