Skip to content

Multi-definition issue of including the DPCTL header in multiple CPP sources #946

Closed
@chengjunlu

Description

@chengjunlu

Hi,

I have two CPP sources include the DPCTL header.
The multi-definition issue happen in linking:

/usr/bin/ld: /tmp/Stream-e835c3.o: in function `std::__detail::_Hash_node<std::pair<_object const* const, std::vector<_object*, std::allocator<_object*> > >, false>::_M_next() const':
/home/guangyey/CLionProjects/pytorch/torch/include/pybind11/pybind11.h:662: multiple definition of `import_dpctl()'; /tmp/Module-08230d.o:/home/guangyey/CLionProjects/pytorch/torch/include/pybind11/pybind11.h:662: first defined here

I can work around the issue by change the import_dpctl to static.

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