When trying to build an ASM-only project I receive the linker error "[Error li1021] The Following Symbols referenced in processor p0 could not be resolved: _main". My project doesn't use 'main', what is the problem?
CraigG wrote: When trying to build an ASM-only project I receive the linker error "[Error li1021] The Following Symbols referenced in processor p0 could not be resolved: _main". My project doesn't use 'main', what is the problem?
As of the introduction of the Startup Code/LDF Generator in VisualDSP++ 4.5, the LDFs produced by VisualDSP++ automatically reference the C Run Time libraries (...basiccrt.doj). These C Run-Time Libraries, in turn, expect an application to contain a 'main' function, which ASM application do not require. As the CRT being linked in expects and references a main function, the linker throws this error. In order to stop the error, you have a few options:1. Create a dummy project, generate a CRT and LDF and then copy the LDF to your working project. The LDF will then need to be modified to removed any mention of the CRT.2. Generate a CRT and LDF in your working project and remove the generated basiccrt.s from your project. Then edit the generated CRT and replacing the call to _main with your code, or a call to your code. Remembering that because that generated code is not within a user modifiable section that it will be clobbered if you were to re-generate any of the files.3. Make a _main function in your assembly code that starts the ball rolling. This option, however, is not viable if you are writing Init Code.4. The default LDFs allow you to provide your own CRT (see -MDUSER_CRT), which can be an empty file, which would not pull anything in. Once again, this is not an option if creating Init Code.In addition to the option above, please be aware that there are example Assembly Init Code projects in "...\Blackfin\ldr\init_code\asm" which you can take a look at. The simplest option may be to copy the LDF from these examples into your project.
Retrieving data ...