Skip to content

Link error with Boost::serialization on Clang+Windows #79

@ahoarau

Description

@ahoarau

Hi,

I encountered some issues with Boost::serialization with clang on windows, and the workaround I found was to remove the INTERFACE_COMPILE_DEFINITIONS.

The error:

lld-link: error: undefined symbol: __declspec(dllimport) public: void __cdecl boost::archive::archive_exception::`vbase dtor'(void)

The workaround:

# Here we remove the INTERFACE_COMPILE_DEFINITIONS, it was containing "BOOST_SERIALIZATION_NO_LIB;BOOST_SERIALIZATION_DYN_LINK"
set_property(TARGET Boost::serialization PROPERTY INTERFACE_COMPILE_DEFINITIONS)

As a side note, it is odd to me that the INTERFACE_COMPILE_DEFINITIONS is filled with BOOST_SERIALIZATION_NO_LIB;BOOST_SERIALIZATION_DYN_LINK, is that wanted ? I feel like it says "disable automatic linking, but also enable it" ?

Some related discussions and commits:
258f786
#54
#62

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