Post Go back to editing

VisualDSP++ 5.1.2 - Error li1021, the complier seemingly can't find #includes

Category: Software
Software Version: VisualDSP++ 5.1.2

so I get the following:

[Error li1021] The following symbols referenced in processor 'p0' could not be resolved:
'adi_initComponents [_adi_initComponents]' referenced from '.\Release\UltraSonic.doj'
'mtbl_clear(medianTable *) [_mtbl_clear__FP11medianTable]' referenced from '.\Release\UltraSonic.doj'
'mtbl_getMedian(medianTable *) [_mtbl_getMedian__FP11medianTable]' referenced from '.\Release\UltraSonic.doj'
'mtbl_insert(medianTable *, float) [_mtbl_insert__FP11medianTablef]' referenced from '.\Release\UltraSonic.doj'
'mtbl_isFull(medianTable *) [_mtbl_isFull__FP11medianTable]' referenced from '.\Release\UltraSonic.doj'

Linker finished with 1 error
cc3089: fatal error: Link failed
Tool failed with exit/exception code: 1.
Build was unsuccessful.

Ok, fine. Those things live in:

#include "UltraSonic/MedianTable.h"
#include "UltraSonic/system/adi_initialize.h"

... and "UltraSonic/system/adi_initialize.h" #includes </sys/platform.h> that #includes  <sys/_adi_platform.h>

So I'll change the code to mention

#include "MedianTable.h"
#include "adi_initialize.h"

...And change the source code in the right places. (What could possibly go wrong!)

Unfortunately, this doesn't work either. The error looks exactly the same? I'd expect it to maybe be confused over </sys/platform.h> and <sys/_adi_platform.h>, but no, I still get:

[Error li1021] The following symbols referenced in processor 'p0' could not be resolved:
'adi_initComponents [_adi_initComponents]' referenced from '.\Release\UltraSonic.doj'
'mtbl_clear(medianTable *) [_mtbl_clear__FP11medianTable]' referenced from '.\Release\UltraSonic.doj'
'mtbl_getMedian(medianTable *) [_mtbl_getMedian__FP11medianTable]' referenced from '.\Release\UltraSonic.doj'
'mtbl_insert(medianTable *, float) [_mtbl_insert__FP11medianTablef]' referenced from '.\Release\UltraSonic.doj'
'mtbl_isFull(medianTable *) [_mtbl_isFull__FP11medianTable]' referenced from '.\Release\UltraSonic.doj'

Linker finished with 1 error
cc3089: fatal error: Link failed
Tool failed with exit/exception code: 1.
Build was unsuccessful.

Any suggestions?

  • Hi,

    We recommend consulting the VisualDSP Help page under Help > Contents > Messages > Linker > Linker Errors > li1021. From this documentation, the error indicates that the linker is unable to resolve a symbol.

    This message provides a list with the names of the symbol that cannot be resolved and for each symbol the name of the file that has the reference to the symbol. The message begins with the name of the link project in which the file was being mapped.

    The error occurs because the linker cannot find a defining occurrence of the symbol to link against in the current project or in the other projects or shared memory listed. To fix this problem, you must know where the identified symbol is supposed to be defined.

    If you are still facing the issues, please share us the example project with the steps to reproduce the issue. Also, let us know which processor that you are using. This will help us to assist you further.

    Regards,
    Nishanthi.V

  • Oh yes, the CPU:


    ** processor: ADSP-BF547

    The complete source code is not really open source, so how do I share that is there some NDA that needs to be worked through or what not?

    I've seen your suggestions summarized a bit more succinctly elsewhere:

    To fix this problem, you must know where the identified symbol is supposed to be defined. The following are possible causes.

    •    A file that contains the definition of the symbol is not included in the link. In this case, add the file to the link.

    •    The symbol is not defined to be global. In this case, open the C or assembly file where the symbol is defined and make sure that the symbol is a global symbol.

    •    A project does not have a complete list of files to link against. For example, you might have a multiprocessor project in which each processor must link against the shared memory. If you do not include the shared memory file in the list of files to link against, a project might not be able to resolve some symbols.

    The first point. Add the file to the link? This refers to Right click Prjoect foo => Project options => Link => General, and the search directories? (I've tried that) and like I said, I've added the .h files in the header files folder in the Project Group.

    The second point.These are supplied files where the code that isn't found resides, so surely they shouldn't have the issue of not being found globally?

    Your point. " you must know where the identified symbol is supposed to be defined". What do you mean by symbol? When I hear symbol I'm thinking of some operator like + - * / and the like? Or do you mean an atomic operation of some sort, atomic type?

  • Hi,

    The symbol represents are which not linked to the project as shown in the error.

    adi_initComponents
    mtbl_clear
    mtbl_getMedian
    mtbl_insert
    mtbl_isFull

    So, you have to make sure to add the header files/ source files to project where the above symbols are declared. For example, "adi_initComponents" has been declared at adi_initialize.h, that should be present in the project folder.

    Likewise ,you must add the other files for which the error is shown.

    If you're unable to share your project setup on this forum, feel free to contact our private support channel at processor.tools.support@analog.com and it would be great if you could share your project so that we may take a closer look at the problem.

    Please make sure to add the link of this Ezone thread while contacting private support.

    Regards,
    Nishanthi.V