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)

Recommended Answers

All 2 Replies

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..

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.