[SOLVED] Same name C and Cpp file error: has been supplied more than once

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • [SOLVED] Same name C and Cpp file error: has been supplied more than once

    In my project , i have 2 motors files. One is motors.cpp, that's apllication use, the other is motors.c that is used by driver
    when compile it shows:
    The object file Ov3 Internal/motors.o has been supplied more than once

    I think it two same name file generate one .o file,make the error.

    I change the file to motors1.c,then it compile ok.

    I could pass by the problem,but i think it's a bug. When i use Eclipse , it' won show any error about it
  • Hello,

    Thank you for your inquiry.
    This is not a bug.
    You will see the same issue with eclipse if you use the same intermediate output folder.
    So either rename the files so they do not have the same name, or set different intermediate output folders for the files in your project.
    You can also change the output file name format.
    Default that Embedded Studio uses is $(IntDir)/$(InputName)$(OBJ) and can be found in project options under:
    Code > Build > Object File Name
    You can change that to e.g. $(IntDir)/$(InputFileName)$(OBJ).

    Best regards,
    Nino
    Please read the forum rules before posting.

    Keep in mind, this is *not* a support forum.
    Our engineers will try to answer your questions between their projects if possible but this can be delayed by longer periods of time.
    Should you be entitled to support you can contact us via our support system: segger.com/ticket/

    Or you can contact us via e-mail.