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 #10234-D unresolved symbols remain and ERROR #10010 error encountered during linking



Can anybody tell how is the following error regarding linking of files and unresolved symbols solved; since it is a common error I encounter while building many of my codes.

In this program I have included the "utils/uartstdio.h" where the definitions for the so called unresolved symbols is given but still the error persists.

Here's the code I used from the examples;


#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "driverlib/adc.h"
#include "driverlib/gpio.h"
#include "driverlib/sysctl.h"
#include "driverlib/uart.h"
#include "utils/uartstdio.h"

#define GPIO_PA0_U0RX 0x00000001
#define GPIO_PA1_U0TX 0x00000401


void
InitConsole(void)
{
//
// Enable GPIO port A which is used for UART0 pins.

SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);


GPIOPinConfigure(GPIO_PA0_U0RX);
GPIOPinConfigure(GPIO_PA1_U0TX);

//
// Select the alternate (UART) function for these pins.

GPIOPinTypeUART(GPIO_PORTA_BASE, GPIO_PIN_0 | GPIO_PIN_1);

//
// Initialize the UART for console I/O.
//
UARTStdioInit(0);
}


int
main(void)
{

unsigned long ulADC0_Value[1];

SysCtlClockSet(SYSCTL_SYSDIV_10 | SYSCTL_USE_PLL | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_16MHZ);


InitConsole();

//
// Display the setup on the console.
//
UARTprintf("ADC ->\n");
UARTprintf(" Type: Single Ended\n");
UARTprintf(" Samples: One\n");
UARTprintf(" Update Rate: 250ms\n");
UARTprintf(" Input Pin: AIN0/PE7\n\n");

SysCtlPeripheralEnable(SYSCTL_PERIPH_ADC0);


SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);



GPIOPinTypeADC(GPIO_PORTE_BASE, GPIO_PIN_3);


//
ADCSequenceConfigure(ADC0_BASE, 3, ADC_TRIGGER_PROCESSOR, 0);

ADCSequenceStepConfigure(ADC0_BASE, 3, 0, ADC_CTL_CH0 | ADC_CTL_IE |
ADC_CTL_END);

//
// Since sample sequence 3 is now configured, it must be enabled.
//
ADCSequenceEnable(ADC0_BASE, 3);

//
// Clear the interrupt status flag. This is done to make sure the
// interrupt flag is cleared before we sample.
//
ADCIntClear(ADC0_BASE, 3);

//
// Sample AIN0 forever. Display the value on the console.
//
while(1)
{
//
// Trigger the ADC conversion.
//
ADCProcessorTrigger(ADC0_BASE, 3);

//
// Wait for conversion to be completed.
//
while(!ADCIntStatus(ADC0_BASE, 3, false))
{
}

//
// Clear the ADC interrupt flag.
//
ADCIntClear(ADC0_BASE, 3);

//
// Read ADC Value.
//
ADCSequenceDataGet(ADC0_BASE, 3, ulADC0_Value);

//
// Display the AIN0 (PE7) digital value on the console.
//
UARTprintf("AIN0 = %4d\r", ulADC0_Value[0]);

// Delay
// 250ms arbitrarily.
//
SysCtlDelay(SysCtlClockGet() / 12);
}
}

CONSOLE OUTPUT 

**** Build of configuration Debug for project ADC Input ****

C:\ti\ccsv5\utils\bin\gmake -k all
'Building target: ADC Input.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"ADC Input.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 "ADC Input.out" "./startup_ccs.obj" "./main.obj" "./am.obj" -l"libc.a" -l"C:\StellarisWare\driverlib\ccs-cm4f\Debug\driverlib-cm4f.lib" "../lm4f120h5qr.cmd"
<Linking>

undefined first referenced
symbol in file
--------- ----------------
UARTStdioInit ./main.obj
UARTprintf ./main.obj

error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "ADC Input.out" not built

>> Compilation failure
gmake: *** [ADC Input.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

  • Hi,

    looks like you've missed to #include "driverlib/pin_map.h".

    Anurag Meena said:

    #define GPIO_PA0_U0RX 0x00000001
    #define GPIO_PA1_U0TX 0x00000401

    Get rid of these tow defines.

    Why did you include "driverlib/uart.h"? Since you're only using UARTStdio for console output there's no need for this include.

    Rgds
    aBUGSworstnightmare 

  • I had to add

    #define PART_LM4F120H5QR

    to my code to access the particular pin set in "pin_map.h"

    it eliminated writing 

    #define GPIO_PA0_U0RX 0x00000001
    #define GPIO_PA1_U0TX 0x00000401

    but the error of unresolved symbols still persists

    and I have removed the "uart.h" too.

  • Hi,

    You need to add also the file utils/uartstdio.c to your project since all routines there are not part of any other library. Simply "#include utils/uartstdio.h" does not solve anything except the declarations for functions used. The linker needs to find out also those functions, so it signals the error if not found. Do that by adding a symbolic link to this file and compile/link again.

    Petrei.

  • Hi,

    I am facing the same problem, could you plz tell me how to add utils/uartstdio.h to the project? I am a beginner here.

    Thanks a lot

    Xu

  • Hi,

    Go to File | Import | General | File System and click Next;

    From Directory: click Browse button on the right; Go to your Tiva/utils folder and select the file uartstdio.c

    Specify the destination of that link (either a sub-folder in your project either your project

    Click the Advanced button at the bottom of the window dialog;

    Check Create links in the workspace and press Finish

    Here is a picture:

  • thank you soooo much!

  • I had the same issue as the OP, and this solution did the trick! Can you please explain to me what this did, though? And why it's necessary? For example, why do I need to do this for items in the "utils" subdirectory, but not the "inc" subdirectory?
  • Hi,
    These are paths problems - and you must solve them. In "inc" directory case this is not needed because the files to be included are declared at the beginning of the file as "include inc/gpio.h" for example, which means it is a local include, and the path to StellarisWare/Tiva is specified in other settings.
    But for .c file this will not work (well, it may, but it is not recommended) since a .c file contains again some "include..." and this will generate double declarations for some functions, which is of coarse, wrong.
    That suggested is one possible solution. The other one is to copy the uartstdio.c and .h files to your project and work with both as your usual files.