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

Trying to debug include files

i have a main program with some include files, and i want to debug this files as well as the main program and use breakpoinds.
Anyone knows how to do this???
Thanks

Parents
  • "the problem isn't with the compiler, but with the linker"

    NO.

    The problem is with neither the compiler nor the linker - it is with your code.

    The compiler only "sees" one 'C' source file at a time; each of your files is "correct" in itself, so you get no compiler errors.

    The problem comes when you try to link the two separate object files together; only then can it be seen that you have two files both defining variables with the same name!

    That's why the Linker tells you, "MULTIPLE PUBLIC DEFINITIONS" - because that's exactly what you've got!

    What you want is just a single definition, and to have all the rest of your code refer to that one "global" variable.

    If, on the other hand, you had wanted two distinct, independent global variables - then you would have had to rename at least one of them.

Reply
  • "the problem isn't with the compiler, but with the linker"

    NO.

    The problem is with neither the compiler nor the linker - it is with your code.

    The compiler only "sees" one 'C' source file at a time; each of your files is "correct" in itself, so you get no compiler errors.

    The problem comes when you try to link the two separate object files together; only then can it be seen that you have two files both defining variables with the same name!

    That's why the Linker tells you, "MULTIPLE PUBLIC DEFINITIONS" - because that's exactly what you've got!

    What you want is just a single definition, and to have all the rest of your code refer to that one "global" variable.

    If, on the other hand, you had wanted two distinct, independent global variables - then you would have had to rename at least one of them.

Children
No data