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.

Compiler/MSP430G2553: MSP430G2553

Part Number: MSP430G2553


Tool/software: TI C/C++ Compiler

Hi, I am trying to run a simple code for blinking LED1 in my MSP430G2553 IN CCSV5 which is as follows:

#include <msp430g2553.h>

unsigned int i;

void main(void) {


// stop watchdog timer
WDTCTL = WDTPW + WDTHOLD;
// set up bit 0 of P1 as output
P1DIR = 0x01;
// intialize bit 0 of P1 to 0
P1OUT = 0x00;

// loop forever
for (;;) {
// toggle bit 0 of P1
P1OUT ^= 0x01;
// delay for a while
for (i = 0; i < 20000; i++);
}
}

I am getting the following errors :

#10010 errors encountered during linking; "MSP430_Learn_1.out" not

#10056 symbol "main" redefined: first defined in "./main.obj"; redefined

Could someone tell me how to fix these ?

Thanks in advance 

  • S_Tewari said:
    #10056 symbol "main" redefined: first defined in "./main.obj"; redefined

    This is the first error to address.  But this diagnostic is incomplete.  I think you copied it from the Problems view.  Look at instead in the Console view, where the full text of the diagnostic is shown.  That diagnostic will tell you where the the second definition of the function main comes from.  Based on what little I see, I suspect you have two source files in your project, and they both implement a main function.  If that is right, you need to remove one of those source files from the project.

    Thanks and regards,

    -George

  • Yes I had two main.c files as soon as i deleted one it was then working perfectly, thank-you !