Skip to content

stream_variable inline declaration causes link error #96

@daniel-larraz

Description

@daniel-larraz

The stream_variable function is declared inline only in the header file:

inline detail::variable_printer stream_variable(const Context& c,
const Variable& v);

Because the function is marked inline without an in-header definition, this can sometimes cause undefined reference errors when linking.

Two potential fixes are:

  1. Remove the inline qualifier from the declaration.
  2. Keep inline but move the definition into the header, for example:
    inline detail::variable_printer stream_variable(const Context& c,
                                                    const Variable& v)
    {
        return detail::variable_printer{c.get_variable_db(), v.get_internal()};
    }

Would it be possible to incorporate one of these fixes?

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