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.

Linker Issue CCS V5 Unresolved Symbols Constantly Changing

I feel like this issue is a simple one and that I have just completely missed a step in setting up my Stellaris Launchpad but I will try anyway. Currently when I try to build my project I am receiving errors involving timer functions GPIO functions and sysctl functions. If I were to build it again I may recieve more or less "unresolved symbols" As far as I understand that means that CCS does not have the necessary includes however, in my program I have. #include "driverlib/sysctl.h" but with all the other necessary includes and the memmap pinmap and types. I checked my includes for my project settings and it includes the directories to search in stellarisware/driverlib. The part that really confuses me is how on one run of my project I am receiving X number of unresolved symbols but on another compile attempt I will get different errors some of the errors go away even though I changed nothing. Please help this is really confusing I am very new to CCS and don't entirely understand how to setup projects in it. Oh also I did copy startup_ccs.c into my project.

  • Hi Patrick,

    are you trying to import and example?  Could you post the exact error you see/console output?

    From your description a couple things come to mind as likely.   It could be you still need to clean up an include path or variable (see the wikis below) or else perhaps is this is from Stellariware .. it is possible you are not bringing in a needed library.    Ie you might be importing or creating a project and bringing in a couple libraries but missing one.

    http://processors.wiki.ti.com/index.php/Include_paths_and_options

    http://processors.wiki.ti.com/index.php/Importing_Projects

    Please keep us informed.

    Best Regards,
    Lisa

  • Lisa,

    No I'm trying to create a brand new project, below you'll see the exact text from my console. Also I just noticed that while my console has been throwing consistent errors my "problems" area has been changing my error report, a little bit miss leading.


    **** Build of configuration Debug for project Serial_test ****

    C:\ti\ccsv5\utils\bin\gmake -k all
    gmake: ../startup_ccs.c: Timestamp out of range; substituting 1969-12-31 19:00:00
    'Building target: Serial_test.out'
    'Invoking: ARM Linker'
    "C:/ti/ccsv5/tools/compiler/tms470_4.9.5/bin/cl470" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --diag_warning=225 --display_error_number -z --stack_size=256 -m"Serial_test.map" --heap_size=0 -i"C:/ti/ccsv5/tools/compiler/tms470_4.9.5/lib" -i"C:/ti/ccsv5/tools/compiler/tms470_4.9.5/include" --reread_libs --warn_sections --display_error_number --rom_model -o "Serial_test.out" "./startup_ccs.obj" "./main.obj" -l"libc.a" "../lm4f120h5qr.cmd"
    <Linking>

    undefined first referenced
    symbol in file
    --------- ----------------

    GPIOPinTypeTimer ./main.obj
    >> Compilation failure
    SysCtlClockSet ./main.obj
    SysCtlDelay ./main.obj
    SysCtlPeripheralEnable ./main.obj
    TimerConfigure ./main.obj
    TimerEnable ./main.obj
    TimerLoadSet ./main.obj
    TimerMatchSet ./main.obj

    error #10234-D: unresolved symbols remain
    error #10010: errors encountered during linking; "Serial_test.out" not built
    gmake: *** [Serial_test.out] Error 1
    gmake: Target `all' not remade because of errors.

    **** Build Finished ****

     Also if it helps I'm going to paste in all of my includes in the file main.c as well as all of the include directory search paths.

    In file:

    #include "inc/hw_types.h"
    #include "inc/hw_memmap.h"

    #include "driverlib/sysctl.h"
    #include "driverlib/gpio.h"
    #include "driverlib/ssi.h"
    #include "driverlib/timer.h" 
    #include "driverlib/pin_map.h" 
    #include "driverlib/adc.h"
    #include "driverlib/i2c.h"

    Search directory paths:

    "${CG_TOOL_ROOT}/include"
    "C:\StellarisWare\driverlib"
    "C:\StellarisWare"
    "C:\StellarisWare\boards\ek-lm4f120xl"

    Thanks for all the help, also I know I have over defined my includes I planned on implementing them later and didn't want to forget them later on, that shouldn't be an issue I don't think.

  • Hi Patrick,

    please also check the include paths and options as per the wiki I sent you.  The errors you get still suggest this type of issue.  CCS/your project needs to know where to find these files.  You need to check there .

    Hope that will help.

    Best REgards,

    Lisa

  • Lisa,

    I did try to follow those instructions to the T. I have all the projects that come with the stellaris launchpad in my workspace and they work fine. I'm using project0 as a basis because the GPIO on this project works fine. When I look at linked resources there are 2 path variables that are in this project but not the one I'm currently working on. The directories for these are "${ORIGINAL_PROJECT_ROOT}\..\..\..\.." and "C:\StellarisWare\boards\ek-lm4f120xl\project0\ccs" The first one I've tried using in my current project but it doesn't seem to like the ${ORIGINAL... name convention so I'm stuck there. The other one really doesn't make sense to put into my project because all I should need is the current working directory there is nothing for my custom project in this directory. Do I maybe need to copy some of the defualt settings from this directory into mine? 

    To my understanding I shouldn't need to important any projects into this one because it is a fresh project. However, I can understand maybe needing to import projects like the USB ones that must be in any workspace for Stellaris to work to my understanding.

    Thanks again for dealing with my likely really beginner question but, it's very frustrating that the thing that's keeping me from experimenting with my launchpad is something a silly as linker errors.

  • Lisa,

    Thank you for your help I finally figured it out. While all of my includes were correct they weren't really. I forgot the crucial step of defining what "SW_ROOT" was. Really dumb mistake but it's fixed now so thank you again. Happily compiling projects now.

    :)

  • Hi Patrick,

    very happy to hear!

    Thanks for the update and all the best with development.

    best regards,
    Lisa

  • Hello!

    I too am stuck at a similar problem.

    Copied code from the TM4C123G Launchpad , PinMUX utility.


    Though none of the includes shows "?" besides them, however, its giving errors like the following :

    unresolved symbol SysCtlPeripheralEnable, first referenced in ./main.obj    Basic             C/C++ Problem
    unresolved symbol GPIOPinTypeGPIOOutput, first referenced in ./main.obj    Basic             C/C++ Problem

    The code is as below :

    /*
     * main.c
     */

    #include <stdint.h>
    #include <stdbool.h>
    #include "New.h"
    #include "inc/hw_types.h"
    #include "inc/hw_memmap.h"
    #include "inc/hw_gpio.h"
    #include "driverlib/sysctl.h"
    #include "driverlib/pin_map.h"
    #include "driverlib/rom_map.h"
    #include "driverlib/gpio.h"

    //*****************************************************************************
    void
    PortFunctionInit(void)
    {
        //
        // Enable Peripheral Clocks
        //
        MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
        MAP_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOD);

        //
        // Enable pin PA4 for GPIOOutput
        //
        MAP_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_4);

        //
        // Enable pin PA5 for GPIOOutput
        //
        MAP_GPIOPinTypeGPIOOutput(GPIO_PORTA_BASE, GPIO_PIN_5);

        //
        // Enable pin PD7 for GPIOOutput
        //

        //
        //First open the lock and select the bits we want to modify in the GPIO commit register.
        //
        HWREG(GPIO_PORTD_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY;
        HWREG(GPIO_PORTD_BASE + GPIO_O_CR) = 0x80;

        //
        //Now modify the configuration of the pins that we unlocked.
        //
        MAP_GPIOPinTypeGPIOOutput(GPIO_PORTD_BASE, GPIO_PIN_7);
    }

    int main(void) {
        
        return 0;
    }

    -----------

    The include directories are (in the Show Build Settinggs in CCSv5 ):

    "${CG_TOOL_ROOT}/include"

    "C:\ti\TivaWare_C_Series-2.1.0.12573"

    Can somebody please help me?

    Thanks!

  • Hi Patrick,

    I am also facing the same problems as yours. Can you please tell me how you eliminated it.

    Thanks