Skip to content

Undefined symbols when use as static library. #367

@charlietsao

Description

@charlietsao

Platform: OSX
IDE: Version 14.3 (14E222b)

CMake Options are:

option(BUILD_RTTR_DYNAMIC "Build the dynamic/shared version of RTTR library" OFF)
option(BUILD_UNIT_TESTS "Build the unit tests of RTTR" OFF)
option(BUILD_STATIC "Build RTTR as static library" ON)
option(BUILD_WITH_STATIC_RUNTIME_LIBS "Link against the static runtime libraries" OFF)
option(BUILD_WITH_RTTI "Enable build with C++ runtime type information for compilation" OFF)
option(BUILD_BENCHMARKS "Enable this to build the benchmarks" OFF)
option(BUILD_EXAMPLES "Enable this to build the examples" OFF)
option(BUILD_DOCUMENTATION "Enable this to build the documentation" OFF)
option(BUILD_INSTALLER "Enable this to build the installer" OFF)
option(BUILD_PACKAGE "Enable this to build the installer" OFF)
option(USE_PCH "Use precompiled header files for compilation" OFF)

Build as static library then used in another project, errors are:

Undefined symbols for architecture x86_64:
  "typeinfo for rttr::detail::method_wrapper_base", referenced from:
      typeinfo for rttr::detail::method_wrapper<void (LabNode::*)(), LabNode, (rttr::access_levels)0, rttr::detail::default_invoke, rttr::detail::default_args<>, rttr::detail::parameter_infos<>, 0ul, rttr::type_list<>> in GeneralMesh.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

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