79671574

Date: 2025-06-19 05:41:46
Score: 0.5
Natty:
Report link

For type definition, you must consider each ".c" file as autonomous :

  1. (structs.c + structs.h) -> has only one definition of Point. It produces structs.o
  2. (main.c + structs.h) -> has only one definition of Point. It produces main.o

If you manually add a definition of Point directly in main.c, you'll have 2 definition of Point in step 2, which leads to the expected error.

Type definition are not kept in ".o" files, so there's no problem of duplicate definition at linking stage.

Reasons:
  • No code block (0.5):
Posted by: Joël Hecht