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.

Compiler error for wiki lab

I am running through the M4F workshop labs (http://processors.wiki.ti.com/index.php/Getting_Started_with_StellarisWare%C2%AE_and_the_ARM%C2%AE_Cortex%E2%84%A2-M4F_Workshop) and cannot get passed the initial lab3 for the following errors:

error #10234-D: unresolved symbols remain

error #10010: errors encountered during linking; "Lab3.out" not built

I am using the LM4F232 demo board and running CCS version 5.1.0.09000.

Here is the location of the project (since I thought this could be the cause of the problem): C:\StellarisWare\boards\TTO_labs

  • Armando,

    Normally, when CCS reports that an unresolved symbol caused an error during linking, it means that the code tried to reference an undefined function.  There are two ways to figure out what specific line of code is causing this.  For one, there was likely a warning generated stating something like " function declared implicitly."  Double clicking this warning in CCS will link you to the function that is unresolved.  The second option would be to examine the console output that resulted from your build.  Just above where the console states "error #10010: errors encountered during linking; "Lab3.out" not built" should be something akin to the following:

    <Linking>

    undefined            first referenced
    symbol                 in file
    ---------                  ----------------
    foo                        ./bar.obj

    This table tells you the source file (bar.obj) containing the bad function reference, along with the function call (foo) that can not be linked.

    The cause for the function not being linked can be anything from a simple typo to an include path not being properly set.  Use the above steps to figure out exactly what function is giving you problems, and if you are unable to use that information to get a clean compile, post the undefined symbol table and we'll figure out why your linker isn't able to link to that function.

  • Thanks for the quick reply. Just as a note, this code has been copied verbatim from the workbook.

    The errors are for the following routines:

    undefined first referenced

    symbol in file

    --------- ----------------

    GPIOPinTypeGPIOOutput ./main.obj

    GPIOPinWrite ./main.obj

    SysCtlClockSet ./main.obj

    SysCtlDelay ./main.obj

    SysCtlPeripheralEnable ./main.obj

     

    This is the list of includes in the code:

    #include "inc/hw_memmap.h"

    #include "inc/hw_types.h"

    #include "driverlib/sysctl.h"

    #include"driverlib/gpio.h"

     

  • Armando,

    Are you receiving any additional errors or warnings?  It sounds like something went wrong with either step 10 or step 11 of the lab, which details how to set up CCS to contain the proper include search paths and how to find where the compiled driver library, driverlib-cm4f.lib, is stored.  I think that if step 10 isn't followed correctly, you will end up with a number of errors about not being able to include the files in inc/ and driverlib/.  If you don't see any of those, then CCS is probably failing to find the .lib for driverlib.  Make sure that there is an entry in the "Include library file or command file as input (--library, -l)" table of project properties->build->Arm Linker->File Search Path for driverlib-cm4f.lib.  Also, make sure that a valid .lib for driverlib exists at the path you've specified.

    If that doesn't fix it, let me know and we'll see what else we can try.

  • When I select properties of lab3, the screen looks different than the one shown in the workbook. I see an option for TMS470 compiler instead of ARM compiler. Is that correct?

  • That is still the area that you need to change.  I'm not sure when the lab workbook you're reference was generated, but I'm guessing the screenshots were generated using a different version of CCS than what you're running with.  By the screenshot you posted, it looks like you need to go through step 10 of the lab again, which details how to add the StellarisWare install directory to your project include path (done by adding the reference ${PROJECT_ROOT}/../../../.." to the "Add dir to #include search path" pane).

    You will also want to make sure you followed step 11 properly.  Due to differences in the version of CCS you're running and the version used to create the workbook, you'll need to look at TMS470Linker as opposed to ARM Linker.  Aside from that, the steps should be the same.

  • This is the location of my project: C:\StellarisWare\boards\MyBoard\Lab3\ccs

    This is the revised screenshot (with steps 10 and 11 added). I manually added "libc.a" although the workbook does not mention it explicitly. It is included in the workbook screen shot though. I am not sure of what it means or of what it does. Without it I get a lot of errors #7.

    These are the compilation results:

    **** Build of configuration Debug for project Lab3 ****

    C:\ti\ccsv5\utils\bin\gmake -k all

    'Building file: ../main.c'

    'Invoking: TMS470 Compiler'

    "C:/ti/ccsv5/tools/compiler/tms470_4.9.5/bin/cl470" -mv7M4 -g --preinclude="libc.a" --preinclude="C:/StellarisWare/boards/MyBoard/Lab3/ccs/../../../../driverlib/ccs-cm4f/Debug/driverlib-cm4f.lib" --include_path="C:/ti/ccsv5/tools/compiler/tms470_4.9.5/include" --include_path="C:/StellarisWare/boards/MyBoard/Lab3/ccs/../../../.." --diag_warning=225 --display_error_number -me --abi=eabi --code_state=16 --float_support=FPv4SPD16 --preproc_with_compile --preproc_dependency="main.pp" "../main.c"

    Fatal error #5: could not open source file "libc.a"

    1 fatal error detected in the compilation of "../main.c".

    Compilation terminated.

    >> Compilation failure

    gmake: *** [main.obj] Error 1

    'Building file: ../startup_ccs.c'

    'Invoking: TMS470 Compiler'

    "C:/ti/ccsv5/tools/compiler/tms470_4.9.5/bin/cl470" -mv7M4 -g --preinclude="libc.a" --preinclude="C:/StellarisWare/boards/MyBoard/Lab3/ccs/../../../../driverlib/ccs-cm4f/Debug/driverlib-cm4f.lib" --include_path="C:/ti/ccsv5/tools/compiler/tms470_4.9.5/include" --include_path="C:/StellarisWare/boards/MyBoard/Lab3/ccs/../../../.." --diag_warning=225 --display_error_number -me --abi=eabi --code_state=16 --float_support=FPv4SPD16 --preproc_with_compile --preproc_dependency="startup_ccs.pp" "../startup_ccs.c"

    Fatal error #5: could not open source file "libc.a"

    1 fatal error detected in the compilation of "../startup_ccs.c".

    Compilation terminated.

    >> Compilation failure

    gmake: *** [startup_ccs.obj] Error 1

    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

  • I suggest looking over step 11 again.  You need to add the library files to the file search path of the TMS470 Linker pane.  From your screenshot, it looks like you added it to the preinclude file list in the TMS470 Compiler pane.

  • I have found the issue. Step 10 is for the compiler while step 11 is for the linker. I was confusing the two. Thank you very much!

  • BTW, your support is world class! Thank you!