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.

Duplicate Definitions error using Starterware Enet_echo example

I am trying to use cpswif from lwIP third party library, and including only its dependencies in the enet_echo example but I keep getting Duplicate definitions error.

after a lot of trying, I tested the following simple case, I built AM335x starterware enet_echo sample project successfully, and added a header file as follows

test.h

#ifndef _test

#define _test

struct foo{

int a;

}foo;

#endif 

When I include this file in enetEcho.c and test.c, I get the error in linking that duplicate definitions for foo exist in enetEcho.o and test,o, although foo isnt declared anywhere except test.h

I have tried cleaning project and deleting Debug folder, but it doesn't resolve the issue.

What's wrong ? and whats the appropriate way to include selected dependencies for using only cpswif from lwIP

  • Moving this to the Starterware forum.

  • Strange, these examples are workign well here.

    Assumed you are using CCS: may be there are some backup-files or other duplicates in your source-directory? CCS automatically adds them to the project which results in very strange error messages.

    And when you are working with Linux: try to inspect the resulting object-files of main.o and enetEcho.o with MidnightCommander to see if these definitions are really available in both.