Skip to content

lzmq should use C++ linker (or ZeroMQ should stop using exceptions) #71

@Elv13

Description

@Elv13

Hello, love this library. I just want to document a problem I had when packaging it for an embedded system with (very) limited storage space. Using the $CC to link lzmq.so is that it only works if libstdc++ is a shared library. If it's a static library, then -lstdc++ gets ignored by GCC and the throw and new symbols are not linked at all. For some dubious reasons, it actually still produce a binary, but it doesn't work (undefined symbols at runtime).

Please either add this to CMakeLists.txt:

set_target_properties(lzmq PROPERTIES LINKER_LANGUAGE CXX)

Maybe wrapped in an CMAKE_CXX_COMPILER_ID check if you want to preserve the ability to compile on system without a C++ compiler, but which a shared libstdc++ library.

Or stop using C++ exception (and that's better). Then it's really only C symbols and wont depend on libstdc++ at all. C++ exceptions are banned in a lot of projects for various reasons, this is one of them.

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