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.

CCS/TM4C123GH6PM: CCS gmake: *** [all] Error

Expert 1030 points
Part Number: TM4C123GH6PM

Tool/software: Code Composer Studio

Hi. I'm getting what I think are linker errors from CCS and don't know how to resolve them. Please see attached file for snipping tool picture of errors. I've tried clicking the link referred to in #10234-D and adding the driverlib.lib library to the gmake command, but that didn't work. The errors seem to stem from my inclusion of the SysCtlClockSet() call. I have used a #include "driverlib/sysctl.h" statement previously, however. Any help would be appreciated. Thanks, HarryCCS TM4C123GH.docx

  • halo said:
    I've tried clicking the link referred to in #10234-D and adding the driverlib.lib library to the gmake command, but that didn't work.

    How and where exactly did you add the library?

    It is the missing driverlib.lib that is causing the unresolved symbol error. The place to add it is in the project's linker options (Project Properties->Build->Linker->File Search Path)

    http://software-dl.ti.com/ccs/esd/documents/sdto_ccs_build-errors.html#error-unresolved-symbols-remain

  • Harry,

    Reference:
    software-dl.ti.com/.../sdto_ccs_build-errors.html

    Although the #include informs the compiler about how to handle the SysCtlClockSet(), it does not contain the body of the function. That is why the linker is failing to find it.

    >>adding the driverlib.lib library to the gmake command
    This is a step in the right direction, but how exactly are you doing this? You should add the location of the library to the Linker search path (check the reference above for details).

    Also, there is a possibility the driverlib.lib does not have this function, but instead another library. One additional possibility is that a #define may be needed to properly set the ROM or RAM use of this function (some driverlib functions are present in ROM code). Unfortunately I am not entirely familiar with this code, but I strongly suggest you to start from an example code of Tivaware.

    Hope this helps,
    Rafael
  • Hi AartiG and desouza. Thanks for your replies. That seems to have fixed it. I thought that by #include-ing the .h files the compiler/linker would compile the relevant .c files and link them into the project. And thanks also for that link to the software-dl.ti.com site; there is so much helpful stuff out there if only you know where to look and what to look for. Harry.

  • Harry,

    Thanks for reporting back your findings.

    As general statements about adding source and library files and including header files:

    - All .c files must be added to the project - either copied to its directory or linked
    - All .h file directories must be configured using the Compiler option --include_path
    - A .c file that is present in a directory that is passed as a --include_path parameter to the compiler is not acknowledged. This option is only for .h files
    - A .c file that is present in the project directory or one of its subdirectories is automatically compiled
    - A .lib file that is present in the project directory or one of its subdirectories is automatically linked
    - All other .lib files present in your system should be configured using the Linker options --search_path and --library in the following way:
    - The .lib directories should be configured using the --search_path option
    - The .lib filenames should be configured using the --library option

    Regards,
    Rafael
  • Thanks again, Rafael, you've been most helpful. Harry.