This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

L6200E Error, Multiple Declarations

I keep getting a linker error suggesting that a few variables (and some functions) have been declared across multiple files. I've triple checked the files (they're not large) and the erring functions/variables have NOT been declared more than once.

Interestingly, it seems to occur between the file that contains the main function and file A for some, and main and B for some others. Which means that the main file is common. But, the main file does not have these declarations.

Can multiple *definitions* of the same C files, or including the same C files across different #include appearances (in different files) cause the problem?

Any help will be appreciated.

Parents
  • Most likely, you have definitions in a header (or headers).

    Obviously, if a header file containing definitions is #included in multiple .c files, then you will get multiple definitions!

    Your headers should contain only extern declarations...

Reply
  • Most likely, you have definitions in a header (or headers).

    Obviously, if a header file containing definitions is #included in multiple .c files, then you will get multiple definitions!

    Your headers should contain only extern declarations...

Children