Trying to Build some simple code, for the TI Tiva Launchpad, to teach me Interrupts and it keeps throwing up "Error: L6200E: Symbol SystemInit multiply defined (by system_tm4c123.o and mazinterrupt.o)."
I would as is my habit not have a clue what this means.
Thank you.
I think the reason for this error is quite simple. You must have two 'SystemInit' functions in your project, one in the module system_tm4c123.c and one in mazinterrupt.c. In C, you can't have two functions with the same name in the same project unless their scope is limited for example with 'static'.
Thanks and yes I do have two instances for SystemInit but they are quite different. The one in the module system is quite a bit more complex and the one in my mazinterupt is only two lines. This generates a couple more question unfortunately: Which SystemInit function should I remove and why and how were you able to look at this an come to such a quick and correct conclusion ? Can you teach me how to fish ?
UPDATE: I removed the instance of SystemInit in the Mazinterupt.C file and it builds and works fine. I'd still love to know how you guys can look at that cryptic error message and quickly distill the problem... If you don't mind
Abraxas said:Which SystemInit function should I remove
You probably need to merge the code somehow. You need to know that the function 'SystemInit' is called from the startup code, even before 'main()' is executed. This function usually initializes the clock tree (PLL), external bus system if necessary and the like. Your small 'SystemInit' function seems to enable a coprocessor, but I cannot really read the screen shot. If you need this coprocessor, you should move this line into the function 'SystemInit' in the module system_tm4c123.c.
Abraxas said:why and how were you able to look at this an come to such a quick and correct conclusion ? Can you teach me how to fish ?
Well, look at the error message. You see the symbol, the fact that it is defined multiple times and the name of both modules. I think this is obvious.
OK.. Finally seeing what you are talking about. It's otherwise all gibberish to me. I've never quite understood why people in the business don't write more intuitive or to-the-point error messages. So I just commented that function in mazinterupt.c out and it built and worked fine. Maybe I should copy those couple of lines into the SystemInit in the startup _tm4c123.c m just to be safe. I'll be hacking this code and combining it with some other code.