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.

Error during linking

hi, I recently have a "error during linking" when I added a new funtion "drivers/buttons.h" in CCS, I added in "include path" . It just show up when I use "buttonspoll()" if I don't use it , the debug session works fine. I don't know what to do, Could you help me, please?

undefined   first referenced
  symbol         in file     
 ---------   ----------------
 ButtonsPoll ./main.obj 

  • Hi,

    You need to add the file drivers/buttons.c to your project and compile it then the linker will find out the missing function.

    Petrei 

  • Hi,

    I added the file "drivers/buttons.c" and don't present  a question mark left in the line '#include "drivers/buttons.c"', but when I compile show the same error (error during linking).  any other ideas?

  • Hi,

    Oh, no like that - never #include .c file(s) - this should be done by importing the file to the src folder or your project folder, depends how it is organized - and then after you select the file, a button "Advanced" in the lower right part of importing window must be clicked and then select to add it as symbolic link - the file will not be moved from the original place, instead the link will call it and compile it. There should be some examples in launchpad tutorial(s) - sure you have done it at least once...

    Petrei 

  • hi,

    Sorry for my bad understanding. My include statement was "#include drivers/buttons.h" sorry, was a typo mistake. I'm newer in CCS, my version is 5.2, could you give me some more steps how to  import it ? I cannot find a button "Advanced" when a click the file in my project explorer :(  I really appreciate ... again sorry for my bad understanding.

  • Hi,

    You must go to the project explorer, click/select project name or source folder and then in main menu click File | Import and from the opening window select General | File System, which will open a window like in the attached picture.

    This picture shows the Advanced button already selected - make it like in this picture and click Finish - and that's it. Note: go to the project Explorer and see the small icon at the left of the name of this file. A small arrow shows/tells you this is a symbolic link.

    Petrei

  • Hi petrei,

    ten thousands thanks for you help :) , it works like a charm, but now is showing this error: "unresolved symbol ROM_GPIODirModeSet, first referenced in ./buttons.obj  " and all the other ROM_xxx in the buttons.c file, it have a small yellow triangle with a excalmation sign in left part of the file. I added "#include rom.h" but still the same. What can I do ?


  • Make sure you have TARGET_IS_BLIZZARD_RB1  defined as a pre-defined symbol in your project settings.  In compiler or linker advanced settings.

    This is the define that tells rom.h which ROM functions exist on a particular device.

    use TARGET_IS_BLIZZARD_RB1 if you have a TM4C  or XM4C labeled part.

    Use TARGET_IS_BLIZZARD_RA3 for LM4F labeled parts.

    Dexter

  • hi,

    where do I find "pre-defined symbol" in my project settings ? I'm new in CCS.

    thanks

  • right click on the project.

    select options

    in the tree on the left under "build" then "ARM Compiler" then "Advanced Options" finally "Predefined Symbols"

  • Hi,

    I did it , and still giving me the same error.

  • What have you got listed in the project settings for directories to search?

    right click on the project -> select properties -> under build -> ARM Compiler -> find Include Options

    In the bottom section of the include options dialog you should have several directories listed.  One of them should point to the boards/ek-lm4f232 directory.

    Also http://www.ti.com/stellarislaunchpadworkshop  has some good tutorials on all the CCS project settings. 

  • Hi,

    I included this directories:

    /../StellarisWare

    /../../boards/ek-lm4f120xl

    ../include

    I'm following the LaunchPad workshop, but when I tried to use "ButtonPoll()" to turn one LED on with left button and other LED to right button, it gave me a error shown before, I linked a "button.c" file to my project (keeping in the instrucction given by other user of the community) after that it shown a different error :

    "unresolved symbol ROM_GPIODirModeSet, first referenced in ./buttons.obj    ButtonPoll             C/C++ Problem"


    It's my first time with this mcu and CCS. I'm using Stalleris LaunchPad.

  • A simple work around for now might be to eliminate ROM_ and MAP_ from the front of any function you see.  This forces the use of flash resident functions from driver library.  For a first timer it can be frustrating getting tied down to some of these details.  In the interest of getting you moving forward and learning about the part and the board just eliminate the ROM calls for now.  You can circle back to them later.

    Every function that can be called with ROM_ can also be called with out it.

    I think the workshop may even have some chapter or info on this later on in the material.

    Dexter

  • hi,

    Now its working !! you're a genuis man. thanks a lot to everyone who help me. This forum is quite fast , I'm astonished. Thanks again. +1 for all.