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.

linking problem/ unresolved symbol



i referred example projects and then i created my own project xyz and 've included all the required header files but still i m getting following errors-

errors encountered during linking; "xyz.out" not built  

unresolved symbol _main, first referenced in C:\\Program  


i m using only assembly coding. Interestingly, when i add a 'c'source file ( "hello world") to my project the above mentioned errors are resolved and the build is complete.

i m using ccsv4.1 core edition with F283x CPU cycle accurate simulator.

  • The default entry point for C programs is c_int00 which performs C initializaton before calling "main". Since this is an assembly only program, you will need to specify the entry point of your application with the -e linker option. You can set this in the Build Properties (right-click on the project, select 'Build Properties' in the context menu, select 'C/C++ Build' in the left pane, select the 'Tool Settings' tab and under the Linker options mode, select 'Symbol Management' and see the option to Specify the program entry point.

  • 1. As you mentioned i see the option specify the program entry point in symbol management. but i don't know what should be the entry point for my project? I mean how does an entry point specified? i think i m clear..!

    2. During the creation of my project i didn't check the box  "Treat as an assemly only project". I created a new project, checked the box for 'assembly only project' and now the build is complete without any errors!

    please guide.

     

     

  • sandeepb said:

    1. As you mentioned i see the option specify the program entry point in symbol management. but i don't know what should be the entry point for my project? I mean how does an entry point specified? i think i m clear..!

    The entry point is the label in your assembly routine at which the program starts.

    sandeepb said:

    2. During the creation of my project i didn't check the box  "Treat as an assemly only project". I created a new project, checked the box for 'assembly only project' and now the build is complete without any errors!

    please guide.



    Checking this box disables the addition of the runtime library. It is the runtime library which contains the boot code for C programs and sets the entry point to c_int00 as I mentioned earlier. So either of the above 2 solutions would allow you to build assembly only projects.

     

  •  ya got it!

    thanks and regards!