Hi guys,
I'm receiving the Error: 'L6200E: Symbol multiply defined'.
I understand one workaround is to include externs, however this is unideal. With most compilers/linkers something such as:
#ifndef bla #define bla
// Content
#endif
Would prevent double inclusion, however it doesn't appear to work with Keil.
Any ideas on a similar solution?
Many thanks
I'm quite aware of what definitions mean and there was never any doubt in my mind as to the difference between this and a declaration, however having never received the error 'L6200E: Symbol multiply defined' before it wasn't immediately obvious (I'm used to symbol errors being related to library linking).
Coding in C++ there's a natural line between definitions only going in class header definitions and declarations in the accompanying cpp, generally with slightly more obvious error messages if you break from this. Likewise, I rarely find myself having to use the keyword 'extern' in an OO environment and am a bit rusty as to its use.
So what I meant by cleaned up with a C++ rewrite was that I simply followed standard C++ coding practise and it naturally solved the issue (after forum users generously highlighted the cause for me) and gave me the OO code I was wanting at the same time.
And thanks Bob for not jumping to conclusions.
That's just because you rarely use globals in C++, the same problem would have occurred in C++ if you had tried the same thing.
Instead you hand around pointers and references. The advantage is that pointers are just addresses, so declaring a class is sufficient, you don't need to know any internals to be able to create a pointer to it. References are just a different syntax for constant pointers (not pointers to constants), so the same applies to them.
I'm quite aware of what definitions mean and there was never any doubt in my mind as to the difference between this and a declaration, [...] Coding in C++ there's a natural line between definitions only going in class header definitions and declarations in the accompanying cpp,
You've just proved yourself wrong in the space of two paragraphs. You got the very difference that you claim to understand fully exactly bass-ackwards in the second part of that quote.
So regardless whether I might have jumped to it or not, you've just proved my conclusion was correct.
Potato Potato, it's called dyslexia, doesn't mean I don't know the difference and rather, the fact that I've appropriately treated the two separately proves the opposite, that's proof, transiently interchanging two words proves nothing on the other-hand, though thank you for pointing out the error so that it doesn't confuse other readers.
doesn't mean I don't know the difference
I'm calling male bovine excrement on that one.
the fact that I've appropriately treated the two separately proves the opposite,
And the fact your started this thread, asking the question you did proves you wrong. If you actually knew which is which, there's just no way the original error message you got from the linker could have been anything but totally clear to you, so you wouldn't have had to ask here to begin with.
And frankly, if you really have dyslexia at that level you're laying claim to, I have to point out you've picked just about the worst profession you possibly could have.
Reason for starting this thread: Error message was new (having never mixed the two before in actuality, familiar only with the notion of symbols in library linking).
Reason for resolution: Understood the problem at hand and resolved (only possible with understanding) - that's called proof fyi.
Reason for profession: Spell-check, documentation and creative license kind of renders dyslexia mute, thankfully dyslexia and logical thinking aren't related, though, the logical reasoning that dyslexia would some how prevent me from doing this profession leaves me somewhat bemused.
Reason for your unprofessional/unfriendly attitude on dedicated product support forums: I don't care, however, you're an annoyance and a distraction so go away.
Unfortunately he sticks around like a particularly bad smell. Must be something relevant to his use of the term male bovine excrement.
This forum is filled with jerks. Just ignore them. Glad you were able to resolve your issues!