Skip to content

Error building library with indirect dependency on object file #10785

@Hsodergren

Description

@Hsodergren

There seems to be a problem when building libraries with indirect dependencies to object files. That is, when calc.ml depends on dep.c which in turn depends on add.o.

I get the following error:

/usr/bin/ld: lib/add.o: in function `add':
add.c:(.text+0x0): multiple definition of `add'; lib/libc_test_stubs.a(add.o):add.c:(.text+0x0): first defined here
collect2: error: ld returned 1 exit status

The issue is also discussed at discuss.ocaml.org.

Reproduction

Specifications

  • Version of dune: 3.16.0
  • Version of ocaml: 5.2.0

Additional information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions