From what I understand, a linker error due to a duplicate symbol means that:
- a symbol was defined in more than one source file
- resulting in the same symbol in two different object files after compilation
- so the linker does not know which of the two symbols he should link to.
While trying to compile a demo project from www.ugfx.io I came across this error:
duplicate symbol _main in:
.build/obj/GFXLIB/demos/modules/gdisp/basics/main.o
ld: 1 duplicate symbol for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [.build/demotest.elf] Error 1
In contrast to every duplicate symbol error I could find on the web there is just one file listed as part of this error. And the source file belonging to this object file has just one main symbol. You can view it here.
How shall I even understand this error? And what could be its cause?