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.

#10056 symbol "xUARTReadQueue1" redefined: first defined in

Hi, I'm having some issues compiling my project on a new computer. I have exactly the same setup, with include paths changed to the new locations, but for some reason there is an error during linking. All other threads mention include protection, which I have, and not to define the variable, only declare it, which I also have.

Overall, the relevant code looks like this:

main.c :

#include "UART.h"
#include "stopwatch.h"
#include "uut_gpio.h"

UART.h :

#ifndef UART_H_
#define UART_H_

xQueueHandle xUARTReadQueue1;

#endif /* UART_H_ */

The stopwatch.h and uut_gpio.h files do not include UART.h, and xUARTReadQueue1 is defined in UART.c and used in both UART.c and main.c. Also seeming strange to me is that the error message doesn't actually say where is is defined or redefined, that is the entire message.
  • Screwed up the formatting and can't see an edit button, here is the comment at the end of the post:

    The stopwatch.h and uut_gpio.h files do not include UART.h, and xUARTReadQueue1 is defined in UART.c and used in both UART.c and main.c. Also seeming strange to me is that the error message doesn't actually say where is is defined or redefined, that is the entire message.
  • Hi Jack,

    I moved this to the (DO NOT USE) TI C/C++ Compiler - Forum since I could not tell what device you were building for? You may have to provide the project or more information about the project or build logs or file structure to help us understand your issue.

    For reference, editing a post can be done by clicking the More button and then selecting Edit.

    Regards,
    Katie
  • This source line from UART.h ...

    Jack Linton said:
    xQueueHandle xUARTReadQueue1;

    will define (not just declare) a global object xUARTReadQueue1 in every source file that includes UART.h.  You probably mean to write ...

    extern xQueueHandle xUARTReadQueue1;

    Please see this FAQ (not from TI) for more discussion of this situation.

    Thanks and regards,

    -George