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.

Importing projects - problems with linking.

Other Parts Discussed in Thread: EK-TM4C1294XL, EK-TM4C123GXL

Hi all,

I've bee having some massive issues when it comes to linking files. Usually I would create a new project, and set it up as it is mentioned in the Workbook (Import vars.ini -> Add "%{TIVAWARE_INSTALL}" etc.). Now when it came to using other libraries that weren't in the standard install path (e.g. the buttons.h file) I would get errors that it is not linked, which I knew.

Therefore I decided to then import a project where I knew the file I wanted to was, and then set it up as mentioned in the Workbook. This is still giving me errors, and it constantly is stating it isn't linked. I've even moved the libraries I wanted to the "/inc/" to see if that would work, but that also gives me linking errors.

I'm at wits end here and getting very frustrated.

  • James,

    What is the exact error you are getting? Could you copy the CCS build log (the output in the CCS build console) to a text file and attach it here? That should give some clues as to the reason for the error.

  • Hello Aarti,

    Here is the log of the console: .

    This time, I followed the steps in the Workbook.

    I created a new project, added the "vars.ini" file, linked the "driverlib.lib" file, and added the "${TIVAWARE_INSTALL}" path to the Include options. I knew it wouldn't find the "buttons.h" file if I simply added "drivers/buttons.h" because it wouldn't be looking in the right path, so I added "examples/boards/ek-tm4c1294xl/drivers/buttons.h" and now it is possible to locate the file, but I still get errors when I try to build it.

    Added: I attached the file Aarti!

    css errors.txt
    **** Build of configuration Debug for project mess_about ****
    
    "C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all 
    'Building file: ../main.c'
    'Invoking: ARM Compiler'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/include" --include_path="c:/TI/TivaWare_C_Series-2.1.0.12573" -g --gcc --define=ccs="ccs" --define=PART_TM4C129CNCPDT --display_error_number --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="main.pp"  "../main.c"
    'Finished building: ../main.c'
    ' '
    'Building target: mess_about.out'
    'Invoking: ARM Linker'
    "C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/bin/armcl" -mv7M4 --code_state=16 --float_support=FPv4SPD16 --abi=eabi -me -g --gcc --define=ccs="ccs" --define=PART_TM4C129CNCPDT --display_error_number --diag_warning=225 --diag_wrap=off -z -m"mess_about.map" --heap_size=0 --stack_size=512 -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-arm_5.2.2/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --xml_link_info="mess_about_linkInfo.xml" --rom_model -o "mess_about.out" "./main.obj" "./tm4c129cncpdt_startup_ccs.obj" "C:/ti/TivaWare_C_Series-2.1.0.12573/driverlib/ccs/Debug/driverlib.lib" "../tm4c129cncpdt.cmd"  -l"libc.a" 
    <Linking>
    
     undefined   first referenced
      symbol         in file     
     ---------   ----------------
     ButtonsInit ./main.obj      
     ButtonsPoll ./main.obj      
    
    error #10234-D: unresolved symbols remain
    
    error #10010: errors encountered during linking; "mess_about.out" not built
    >> Compilation failure
    gmake: *** [mess_about.out] Error 1
    gmake: Target `all' not remade because of errors.
    
    **** Build Finished ****

  • James,

    I cannot get to that site where you have posted the file, it is blocked from within TI. Could you just attach the file to your forum reply? Thanks!
  • Aarti,

    I attached it to my previous reply. Thanks for the help!
  • James,

    The linker is reporting undefined symbol errors for ButtonsInit and ButtonsPoll. These errors mean that the linker was unable to find a definition for those symbols. Definitions may come from C source files or from libraries. From looking in TivaWare, it appears that these functions are defined in buttons.c. Do you have this source file added to the project? 

  • I have indeed included this in my project, I tried it different ways but it never worked.

    I tried to move the actual source file to a location where I knew I was reading different source files, e.g. "driverlib/" and "inc/" but this didn't work. I tried to add it with "Add files" but this also didn't work. I imported a project which includes the "buttons.h" source file, but this also didn't work so I'm a bit confused about all of it.
  • James Kent69 said:
    I have indeed included this in my project, I tried it different ways but it never worked.

    I tried to move the actual source file to a location where I knew I was reading different source files, e.g. "driverlib/" and "inc/" but this didn't work. I tried to add it with "Add files" but this also didn't work. I imported a project which includes the "buttons.h" source file, but this also didn't work so I'm a bit confused about all of it.

    Are you sure you added the file buttons.c (not buttons.h) to the project? The reason I ask is because you refer to buttons.h in your reply. If you indeed have buttons.c added to the project you should see it being built in the CCS build console? Do you see that happen?

  • Ah, that might be where I went wrong. So you're saying I should include my buttons.h in my main.c file (by means of #include "buttons.h" but add the buttons.c file to my project (by means of "Add files").
  • James Kent69 said:
    So you're saying I should include my buttons.h in my main.c file (by means of #include "buttons.h" but add the buttons.c file to my project (by means of "Add files").

    That is correct. Let us know if that resolves the build errors.

  • Hi James,

    I am getting the same error as AartiG:

    C:\ti\TivaWare_C_Series-2.1.0.12573\examples\boards\ek-tm4c123gxl\uart_echo\uart_echo.c(19): error:  #5: cannot open source input file "drivers/buttons.h": No such file or directory

     #include "drivers/buttons.h"

    I have added buttons.c to my main c file "uart_echo.c", and the #include line is in this c file.

    Any other ideas? When I remove this include statement the code compiles with no problems.

    Thanks!

  • Nevermind! right after I posted I changed the line to:

    #include "buttons.h"

    and moved buttons.h into the same directory as my project, and it worked!

    -- Lee