Hi, I'm currently working on this code, but it keeps on giving me this error:"linker command failed with exit code 1" and I can't figure out how to get rid of it?
The copy constructor is called whenever an object is initialized
initialization: T a = b; or T a(b);, where b is of type T;
> ld: 11 duplicate symbols for architecture x86_64
don't cut the message. prior to that it should have told you what symbols were duplicated.
also, when asking about linker errors you should show the build command, because the error may be there.
> ld: 11 duplicate symbols for architecture x86_64
don't cut the message. prior to that it should have told you what symbols were duplicated.
also, when asking about linker errors you should show the build command, because the error may be there.
This. Use all information. Provide all information. If you do not know what is relevant, then assume that everything is.
A build has multiple steps.
* Compilation: compiler produces an object file for each translation unit.
Within compilation preprocessor prepares translation unit for the compiler.
* Linking: linker combines object files and libraries into binary.
If one gets a linker error, that means that compilation step has succeeded. The compiler has not encountered objectionable syntax (although code can be full of logical errors).
When you see an error, there can be multiple lines of it. (I've heard of "simple" syntax error generating 1000 lines of output.) Focus on the first, not the last. After the first error the system can already be so "off the track" that the rest of the error messages are nonsense.