Please explain when this error occurs..

duplicate symbol _Firstdata in:
    list.o
    main.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

See Firstdata? Whatever that is, you're defining it in list.cpp and again in main.cpp

This is bad. Only define it in one file.

Thanks I got this error..it was a stupid linker error...declared the variable with extern in the header and it worked like charm..